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

From Tom Lane
Subject Re: [PATCHES] dollar quoting
Date
Msg-id 5693.1076823904@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>)
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> Tom Lane wrote:
>> ... But how about
>> 42$foo$
>> This is a syntax error in 7.4, and we propose to redefine it as an
>> integer literal '42' followed by a dollar-quote start symbol.

> The test should not succeed anywhere in the string '42$foo$'.

No, it won't.  The problem is that it should, because the backend will
see that as '42' followed by a $foo$ quote start.

> Interacting with lexer states would probably be ... unpleasant. Matching
> a stream oriented lexer with a line oriented CLI would be messy I suspect.

I think it would not be that bad.  We'd have to run the lexer on the
command input buffer and see what state it terminates in.

            regards, tom lane

pgsql-hackers by date:

Previous
From: "Bort, Paul"
Date:
Subject: Re: Cannot read block error.
Next
From: Neil Conway
Date:
Subject: Re: Renaming tables to other schemas