Re: per-column FDW options, v5

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: per-column FDW options, v5
Дата
Msg-id CA+Tgmob1WbasJ+DPpg8A=iCjOcf82Ltnni4taVeDQVh22KDJEQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: per-column FDW options, v5  (Shigeru Hanada <shigeru.hanada@gmail.com>)
Ответы Re: per-column FDW options, v5  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-hackers
2011/8/9 Shigeru Hanada <shigeru.hanada@gmail.com>:
> (2011/08/09 1:16), Robert Haas wrote:
>> 2011/8/8 Shigeru Hanada<shigeru.hanada@gmail.com>:
>>>>> 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?
>>
>> I'm against #2, but I could go either way on #1 vs. #3.  If you pick
>> #3, would you also change the column options to be displayed that way,
>> or would we end up with table and column options displayed
>> differently?
>
> I'd like to pick #3, and also change per-column options format.  In
> addition, I'd like to change options format for other FDW objects such
> as wrappers, servers and user mappings for consistency.  Of course, only
> if it's acceptable to break backward compatibility...

I think it's fine to change the display format.  We haven't had these
features for very long, so users hopefully shouldn't be expecting that
everything is set in stone.  We have made far bigger changes to
backslash commands that have been around for far longer (\df, I'm
looking at you).

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


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: psql document fix about showing FDW options
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Extra check in 9.0 exclusion constraint unintended consequences