Sorry, I've missed sending copy to list, so I quoted off-list discussion.

> On Aug 5, 2011, at 7:59 PM, Shigeru Hanada<shigeru.han...@gmail.com>
wrote:
>
>> 2011/8/6 Robert Haas<robertmh...@gmail.com>:
>>> Done.
>>
>> Thanks!
>>
>>> Incidentally, I notice that if you do:
>>>
>>> \d some_foreign_table
>>>
>>> ...the table-level options are not displayed.  We probably ought to do
>>> something about that...
>>
>> Currently table-level options are showin in result of \det+ command
>> (only verbose mode), in same style as fdw and foreign servers.
>>
>> But \d is more popular for table describing, so moving table-level
>> options from \det+ to \d might be better.  Thoughts?

(2011/08/06 9:26), Robert Haas wrote:
> I'd show it both places.

After taking a look at describe.c, I think some styles are applicable to
FDW options in result of \d command.

(1) simple array literal style
Show table-level FDW options like other FDW options.  It is  simply a
result of array_out(); each options is shown as "key=value" with quoting
if necessary and delimited by ','.  Whole line is surrounded by { and }.
 If an element includes any character which need to be escaped, such
element is quoted with double-quotation.

    Ex)
    FDW Options: {"delimiter=,","quote=\""}
    #delimiter is a comma, and qutoe is a double-quote

(2) reloptions style
Show FDW options like reloptions of \d+ result.  Each options is shown
as "key=value" without quoting.  Some special characters might make it
little illegible.

    Ex)
    FDW Options: delimiter=,, quote="
    #delimiter is a comma, and qutoe is a double-quote

(3) OPTIONS clause style
Show FDW options as they were in OPTIONS clause.  Each option is shown
as "key 'value'", and delimited with ','.

    Ex)
    FDW Options: delimiter ',', quote ''''
    #delimiter is a comma, and qutoe is a single-quote

(1) can be implemented with minimum change, and it also keeps the
behavior consistent with other existing FDW objects.  But IMHO (3) is
most readable, though it breaks backward compatibility about the format
of FDW options used in the result of \d* command.  Thoughts?

BTW, I found wrong description about per-table FDW options; psql
document says that \d+ shows table-level FDW options, but actually it
doesn't show.  I'll post this issue in another new thread.

Regards,
-- 
Shigeru Hanada

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to