Re: quoting psql varible as identifier

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: quoting psql varible as identifier
Дата
Msg-id 162867791001021059u611e4487mc790ed7ddc1605@mail.gmail.com
обсуждение исходный текст
Ответ на Re: quoting psql varible as identifier  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
2010/1/2 Tom Lane <tgl@sss.pgh.pa.us>:
> Pavel Stehule <pavel.stehule@gmail.com> writes:
>> here is patch
>
> I looked at this patch a bit, and I think the real problem with it is
> that it's not multibyte safe.  You've copied backend code that is
> allowed to assume it's in a safe encoding (ie, one where multibyte
> characters can't contain non-high-bit-set bytes).  This is not okay
> on the client side, see SJIS and similar encodings.
>

this code is taken from pg_dump, so if I understand it well, this is
littl bit different case.

> Where you need to start out is by cloning PQescapeStringConn, which does
> a similar type of transformation correctly even in unsafe encodings.
> I think we'd agreed upthread that libpq should provide
> PQescapeIdentifier functionality anyhow.
>

ok

> Once you've actually read that code, you'll realize that it's okay to
> treat the error result as a warning, which resolves the other point
> of concern.  Just print the message and use the result anyway.

ok.

Pavel

>
>                        regards, tom lane
>


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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: quoting psql varible as identifier
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [BUG?] strange behavior in ALTER TABLE ... RENAME TO on inherited columns