As the above answer mentioned, using double quotes should work.
This also worked in postgres.
INSERT INTO test (field) VALUES (E'123\'123'); select * from test; -- 123'123