Quoted string in select and insert - Mailing list pgsql-novice

From Alexander Reichstadt
Subject Quoted string in select and insert
Date
Msg-id 87978B25-97BC-436D-B4FA-959D95492B16@mac.com
Whole thread Raw
Responses Re: Quoted string in select and insert
Re: Quoted string in select and insert
List pgsql-novice
Hi,

I just migrated from mysql and am running into an issue I found no solution for when researching. Using the web
interfaceI can insert values that contain single-quotes. But using the CLI I found no way to select or insert single
quotes:

PetWork=# select * from persons where firstname='\'Peter\'';
Invalid command \'';. Try \? for help.
PetWork-# select * from persons where firstname='\\'Peter\\'';
Invalid command \. Try \? for help.
PetWork-# select * from persons where firstname='\\\'Peter\\\'';
Invalid command \. Try \? for help.
PetWork-# select * from persons where firstname='\\\\'Peter\\\\'';
Invalid command \. Try \? for help.
PetWork-# select * from persons where firstname='\\\\'Peter\\\\'';

On different forums the solution suggested is to prepend backslashes. But it doesn't matter how many backslashes I
prepend,it always fails. What does one have to do to achieve that? 

Thanks for any help


pgsql-novice by date:

Previous
From: Philip Couling
Date:
Subject: Re: Newbie question
Next
From: Bartosz Dmytrak
Date:
Subject: Re: Quoted string in select and insert