Andrew Dunstan wrote:
> Tom Lane wrote:
>> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>>> After staring at the code for a long time, I think I see how to do
>>> this. It's complicated a bit by the fact that $ is a valid
>>> identifier character. So my current thinking is to say that if we
>>> see $ not in a quote and not preceded by a valid identifier char
>>> then it is the start of a $foo$ sequence. Or have I missed
>>> something? Can we validly see $ in any other context?
I had missed one, though - numbered params in prepared statements. Fixed
in attached patch.
>> Right, a $ should be considered to start a quote marker only if it's not
>> part of an identifier. The backend lexer doesn't have a problem with
>> this because it's written in flex, but I can imagine that getting it
>> right in psql's ad-hoc parser might be tricky.
> I think it's doable, though. I seem to have a working patch, which I
> will send out for review soon.
Proof of Concept patch (i.e. not for application) attached for review.
The scanner changes are based on Tom's original, with some name/comment
changes and a more liberal pattern. The psql changes are all my own work
Comments welcome. Reviewers: I am not sure I got multi-byte stuff right
in psql/mainloop.c - please pay close attention to that.
If I'm not wildly off course I will polish this up and start on docs.
In response to
pgsql-hackers by date
|Next:||From: Kevin Brown||Date: 2004-02-08 21:54:51|
|Subject: Re: [pgsql-hackers-win32] Sync vs. fsync during checkpoint|
|Previous:||From: Thomas Hallgren||Date: 2004-02-08 19:56:24|
|Subject: Re: session persistent data for plperl|
pgsql-patches by date
|Next:||From: Magnus Hagander||Date: 2004-02-08 21:24:25|
|Subject: Updated win32 readdir patch|
|Previous:||From: David Garamond||Date: 2004-02-08 18:30:44|
|Subject: Re: connectby for BYTEA keys|