Skip site navigation (1) Skip section navigation (2)

Re: quoting psql varible as identifier

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: quoting psql varible as identifier
Date: 2009-12-29 20:19:57
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers

here is patch

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


2009/12/29 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:
> 2009/12/29 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
>> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
>>> 2009/12/29 Alvaro Herrera <alvherre(at)commandprompt(dot)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

Attachment: variable_escaping.diff
Description: text/x-patch (6.8 KB)

In response to


pgsql-hackers by date

Next:From: Tom LaneDate: 2009-12-29 20:32:23
Subject: Re: Stats for inheritance trees
Previous:From: Pavel StehuleDate: 2009-12-29 20:05:53
Subject: Re: quoting psql varible as identifier

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group