Re: quoting psql varible as identifier

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: quoting psql varible as identifier
Дата
Msg-id 15934.1262666076@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: quoting psql varible as identifier  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: quoting psql varible as identifier  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Mon, Jan 4, 2010 at 2:51 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
>> I don't have a problem to write second and safe fmtId
>> function (with technique used in dumputils don't need to modify
>> libpq), although fmtId do exactly what I need. I would to understand
>> to behave.

> I think you mean that you would need to understand how it should
> behave - in which case I agree, but I think  Tom spelled that out
> pretty clearly upthread: close PQescapeStringConn and adapt it to be
> PQescapeIdentifier.

The more important point here is that fmtId doesn't do "exactly what you
need" in any case.  fmtId is safe to use in pg_dump because pg_dump is
only expected to work with the same or older version of the backend.
It would not be safe to use it in libpq, which is expected to still work
with newer backends that might have more reserved words.
        regards, tom lane


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Index-only scans will not be in PG 8.5
Следующее
От: "David E. Wheeler"
Дата:
Сообщение: Re: PATCH: Add hstore_to_json()