Re: problems with single quotes.. - Mailing list pgsql-sql

From Tom Lane
Subject Re: problems with single quotes..
Date
Msg-id 20966.1007305222@sss.pgh.pa.us
Whole thread Raw
In response to problems with single quotes..  ("Megalex" <megalex@klanomega.com>)
Responses Re: problems with single quotes..
List pgsql-sql
"Megalex" <megalex@klanomega.com> writes:
> Insert Into table(userID,FirstName,LastName) values(1,'''\''','test')

You're not counting/escaping your quotes correctly.  That literal is
unterminated:

'        opening quote
''        quoted quote (to put a quote in the string)
\'        escaped quote (another way to do the same)
''        quoted quote
oops        you're still inside the literal

I don't know what combination of quotes and/or backslashes you actually
meant to insert, but this command is wrong.
        regards, tom lane


pgsql-sql by date:

Previous
From: Joe Conway
Date:
Subject: Re: problems with single quotes..
Next
From: "Anthony Bouvier"
Date:
Subject: Re: Unexpected Return from Function