Re: info about patch: using parametrised query in psql

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: info about patch: using parametrised query in psql
Дата
Msg-id 162867790912251109i700a952ei9618fc26909e86d2@mail.gmail.com
обсуждение исходный текст
Ответ на Re: info about patch: using parametrised query in psql  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
2009/12/25 Robert Haas <robertmhaas@gmail.com>:
> 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 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
>


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: ORDER BY clause in aggregate doesn't work well with multi argument aggregates
Следующее
От: Tom Lane
Дата:
Сообщение: Re: info about patch: using parametrised query in psql