Re: Change format of FDW options used in \d* commands

Поиск
Список
Период
Сортировка
От Shigeru Hanada
Тема Re: Change format of FDW options used in \d* commands
Дата
Msg-id 4E4E0E6F.5000608@gmail.com
обсуждение исходный текст
Ответ на Re: Change format of FDW options used in \d* commands  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Change format of FDW options used in \d* commands  (Robert Haas <robertmhaas@gmail.com>)
Re: Change format of FDW options used in \d* commands  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
(2011/08/18 23:21), Robert Haas wrote:
> ISTM you should do quote_ident() on the option names.  For example, after:
>
> create foreign data wrapper dummy;
> create server s1 foreign data wrapper dummy;
> create foreign table ft1 (a int) server s1 options ("(" ')');
>
> With your patch, I get:
>
> rhaas=# \d+ ft1
>                       Foreign table "public.ft1"
>   Column |  Type   | Modifiers | FDW Options | Storage | Description
> --------+---------+-----------+-------------+---------+-------------
>   a      | integer |           |             | plain   |
> Server: s1
> FDW Options: (( ')')
> Has OIDs: no
>

Oops, good catch.  I've fixed psql to use quote_ident() for option_name,
and modified regression tests to use special characters in option names.
 Please try revised version of patch.

BTW, I noticed that pg_dump has same issue since 8.4, initial release of
SQL/MED infrastructure.  If a FDW option was defined on any FDW object
with a name which contains one of special characters such as space and
parentheses, pg_dump generates invalid OPTIONS clause such as "OPTIONS
(separated name 'value')".
 ~~~~~~~~~~~~~~
Perhaps this issue has been overlooked because dblink is practically the
only use case of FDW option before 9.1.  Since 9.1, users might get
various FDW and some of those might use special characters in option
name.  ISTM that this fix should be back-patched, at least to 9.1.
Please find attached patches for each STABLE branch.

Regards,
--
Shigeru Hanada



Вложения

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

Предыдущее
От: EazonGuo
Дата:
Сообщение: how to get the effected row after execute a query
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: how to get the effected row after execute a query