Re: problems with single quotes..

From: Joe Conway <joseph(dot)conway(at)home(dot)com>
To: Megalex <megalex(at)klanomega(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: problems with single quotes..
Date: 2001-12-02 14:52:09
Message-ID: 3C0A4019.6040004@home.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Megalex wrote:

> ok.. here is my deal..
>
> everytime i try to run an insert and my text contains '\'
> it fails..
>
> an sql example would be.
>
> Insert Into table(userID,FirstName,LastName) values(1,'''\''','test')
> and i get this message...
>
> Error while executing the query; ERROR: parser: parse error at or near
> "test"
>
> how can i fix this??

It isn't clear to me what literal you're trying to insert, but it looks
like it's either:

vsreg_192=# select '\'\'\\\'\'';
?column?
----------
''\''
(1 row)

or

vsreg_192=# select '\'\\\'';
?column?
----------
'\'
(1 row)

HTH,

Joe

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2001-12-02 15:00:22 Re: problems with single quotes..
Previous Message Stephan Szabo 2001-12-02 07:48:57 Re: problems with single quotes..