Re: [HACKERS] Change format of FDW options used in \d* commands
2011/8/19 Shigeru Hanada : > 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. This part looks good to me, too. Committed. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] Change format of FDW options used in \d* commands
2011/8/19 Shigeru Hanada : > 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. Good catch, committed. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] Change format of FDW options used in \d* commands
2011/8/18 Shigeru Hanada : > 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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers