Re: info about patch: using parametrised query in psql

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: info about patch: using parametrised query in psql
Date: 2009-12-25 19:09:36
Message-ID: 162867790912251109i700a952ei9618fc26909e86d2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2009/12/25 Robert Haas <robertmhaas(at)gmail(dot)com>:
> On Fri, Dec 25, 2009 at 1:41 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)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 could to live with

:'foo' and :"foo" although ' and " characters are not the best for
readability. But the mnemonic is clear.

Pavel

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-12-25 19:12:43 Re: info about patch: using parametrised query in psql
Previous Message Tom Lane 2009-12-25 19:08:26 Re: ORDER BY clause in aggregate doesn't work well with multi argument aggregates