Re: quoting psql varible as identifier

Pavel Stehule <pavel.stehule@gmail.com>

From: Pavel Stehule <pavel.stehule@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alvaro Herrera <alvherre@commandprompt.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>, Robert Haas <robertmhaas@gmail.com>
Date: 2009-12-29T20:19:57Z
Lists: pgsql-hackers

Attachments

hello

here is patch

pavel@postgres:5432=# \set foo 'hello world'
pavel@postgres:5432=# SELECT :'foo' AS :"foo";
 hello world
-------------
 hello world
(1 row)

Regards
Pavel


2009/12/29 Pavel Stehule <pavel.stehule@gmail.com>:
> 2009/12/29 Tom Lane <tgl@sss.pgh.pa.us>:
>> Pavel Stehule <pavel.stehule@gmail.com> writes:
>>> 2009/12/29 Alvaro Herrera <alvherre@commandprompt.com>:
>>>> Can we use a trick similar to pg_dump's?
>>
>>> I see it - we can move function (content) fmtId from dumputils.c to libpq.
>>
>> This is not a good idea.  pg_dump can be expected to be up-to-date with
>> the backend's keyword list, but libpq cannot.
>>
>> Just quote the thing unconditionally.  It's not worth working harder
>> than that anyway.
>
> I see it.
>
> Pavel
>
>>
>>                        regards, tom lane
>>
>