SELECT p.* FROM posts as p
WHERE (SELECT COUNT(*) FROM tags as t LEFT JOIN post_tag as pt ON pt.tag_id = t.id WHERE pt.post_id = p.id) = 3
AND
(SELECT COUNT(*) FROM tags as t LEFT JOIN post_tag as pt ON pt.tag_id = t.id WHERE pt.post_id = p.id AND t.id IN (1,2,3) ) = 3