Re: Problem with apostrophes in TK frontend - Mailing list pgsql-bugs

From Chris
Subject Re: Problem with apostrophes in TK frontend
Date
Msg-id 3A424C96.B7CEF03C@libertysurf.fr
Whole thread Raw
In response to Problem with apostrophes in TK frontend  (pgsql-bugs@postgresql.org)
List pgsql-bugs
> insert into "tab1" ("taet","text","text2","id") values ('skldgj 'dgk dlf','dgsdfkl gh ;sdfgh
> dlfkgh','dfl;sj gkl;j','456464654')
>
> ERROR:  parser: parse error at or near "dgk"
>

Of course it is not correctly quoted. If you want to insert a quote in the
string, just put it twice.

insert into "tab1" ("taet","text","text2","id") values ('skldgj ''dgk
dlf','dgsdfkl gh ;sdfgh
dlfkgh','dfl;sj gkl;j','456464654')

if you want to insert a backslash, it's the same :

insert into "tab1" ("text") values ('need a \\ ?');

Hope this will solve your problem.

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: postgresql process crashes on select * from cmd_sm (which is a view)
Next
From: Chris
Date:
Subject: Re: bug