Re: [PATCHES] dollar quoting - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCHES] dollar quoting
Date
Msg-id 8642.1076863360@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCHES] dollar quoting  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: [PATCHES] dollar quoting  (Andrew Dunstan <andrew@dunslane.net>)
Re: [PATCHES] dollar quoting  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
>> No, it won't.  The problem is that it should, because the backend will
>> see that as '42' followed by a $foo$ quote start.

> Ok, I see what you are saying. This mismatch would only happen on
> invalid input, though. I believe that what I did will work on all legal
> input.

I'm unconvinced.  Even if there are not any current syntaxes in which a
numeric literal can be adjacent to a string literal (I'm not totally
sure about that), what of the future?  We should solve the problem
rather than assuming it won't bite us.

> I think that this might be cured by having psql recognise a legal
> identifier or keyword and eating it as a word, rather than treating it
> as just another set of bytes in the stream.

Hm, might work ... will think about it ...

            regards, tom lane

pgsql-hackers by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: [SQL] 7.4 - FK constraint performance
Next
From: Robert Treat
Date:
Subject: Re: RFC: Security documentation