Re: Change format of FDW options used in \d* commands - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Change format of FDW options used in \d* commands
Date
Msg-id CA+Tgmob7Xrh2kit8exvWkmkKMBDyMX6-up1yy0QOJWJFvAENrg@mail.gmail.com
Whole thread Raw
In response to Re: Change format of FDW options used in \d* commands  (Shigeru Hanada <shigeru.hanada@gmail.com>)
Responses Re: Change format of FDW options used in \d* commands
List pgsql-hackers
2011/8/18 Shigeru Hanada <shigeru.hanada@gmail.com>:
> Thanks for the review.
>
> (2011/08/13 3:59), Robert Haas wrote:
>> IMHO, the new format should put parentheses around the options list.
>
> Agreed.  Revised version of patch has been attached.  This version puts
> parentheses around FDW option only when it was not NULL.

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

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Displaying accumulated autovacuum cost
Next
From: Peter Eisentraut
Date:
Subject: Re: Displaying accumulated autovacuum cost