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

From Christopher Kings-Lynne
Subject Re: [PATCHES] dollar quoting
Date
Msg-id 40316B42.7060407@familyhealth.com.au
Whole thread Raw
In response to Re: [PATCHES] dollar quoting  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [PATCHES] dollar quoting  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> Actually, I thought the way to handle it would be to duplicate the
> backend lexer as nearly as possible.  Most of the productions would have
> empty bodies probably, but doing it that way would guarantee that in
> fact psql and the backend would lex a string the same way, which is
> exactly the problem we are facing here.  You'd fall out of the lexer
> only upon detecting backslash (unless we want to put backslash command
> lexing into the flex code, which might or might not be a good idea),
> or upon detecting a ';' at parenthesis depth 0, or upon hitting end of
> string.  In the last case the lexer state would indicate which prompt
> we need to give.

You know what would be really sweet?  If the lexing was made available 
as a public function.  eg. So I could parse queries in phpPgAdmin before 
sending them to the backend, etc...

Chris


pgsql-hackers by date:

Previous
From: "Simon Riggs"
Date:
Subject: Re: [PATCHES] update i386 spinlock for hyperthreading
Next
From: Tom Lane
Date:
Subject: Re: [PATCHES] dollar quoting