Tom Lane wrote:
>Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>>Tom Lane wrote:
>>>... But how about
>>>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.
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
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. That would enable us to
avoid the lookback in the dollar-quote recognition test altogether. The
attached patch does it that way - the keyword/id test needs to come
right at the end of the loop to avoid clashing with backslash commands,
I *think* that this way psql will recognise the start of a dollar quote
iff the backend lexer would.
>>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.
Yeah. I am not enough of a flex wizard to undertake the task, though. It
would take me lots of time. If we make a decision that we really need
this in order to do dollar quoting in psql I would need some substantial
help, at least.
In response to
pgsql-hackers by date
|Next:||From: Tom Lane||Date: 2004-02-15 16:26:53|
|Subject: Re: [pgsql-hackers-win32] Sync vs. fsync during checkpoint |
|Previous:||From: Florian Weimer||Date: 2004-02-15 13:05:16|
|Subject: Re: [pgsql-hackers-win32] Sync vs. fsync during checkpoint|
pgsql-patches by date
|Next:||From: Tom Lane||Date: 2004-02-15 16:42:40|
|Subject: Re: [HACKERS] dollar quoting |
|Previous:||From: Thomas Hallgren||Date: 2004-02-15 14:21:40|
|Subject: Re: Some new SPI functions |