Re: info about patch: using parametrised query in psql - Mailing list pgsql-hackers

From Robert Haas
Subject Re: info about patch: using parametrised query in psql
Date
Msg-id 603c8f070912251106j21fd810eo5626c1423116dcff@mail.gmail.com
Whole thread Raw
In response to Re: info about patch: using parametrised query in psql  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: info about patch: using parametrised query in psql  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: info about patch: using parametrised query in psql  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Dec 25, 2009 at 1:41 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Pavel Stehule <pavel.stehule@gmail.com> writes:
>> there are two quoting styles, so we need two syntax. I proposed
>
>> :[var] and :{var} - for ident quoting and literal quoting.
>> Theoretically we could to use :(var) for bytea escaping.
>
> And if you need a fourth style, you're at a dead end.  I don't think
> this is really an improvement over the single-flag-character approach.
> Neither one has got any mnemonic value whatever, unfortunately, but
> at least the flag character method is fairly extensible.

The lack of mnemonic value kind of sucks, but I don't see that Pavel's
style is any more or less extensible than your proposed flag
character.  Basically, he's saying that the flag characters will be [
and { and adding a closing delimeter to match.  If we do want to go
with a single flag character, maybe it should just be a single or
double quote:

:'foo - quote as a literal
:"foo - quote as an ident

I dunno what to do about bytea-escaping under this framework, though.

...Robert


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: ORDER BY clause in aggregate doesn't work well with multi argument aggregates
Next
From: Tom Lane
Date:
Subject: Re: ORDER BY clause in aggregate doesn't work well with multi argument aggregates