Re: psql document fix about showing FDW options - Mailing list pgsql-hackers

From Shigeru Hanada
Subject Re: psql document fix about showing FDW options
Date
Msg-id 4E4109A1.5030601@gmail.com
Whole thread Raw
In response to Re: psql document fix about showing FDW options  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: psql document fix about showing FDW options
List pgsql-hackers
(2011/08/09 1:20), Robert Haas wrote:
> 2011/8/8 Shigeru Hanada<shigeru.hanada@gmail.com>:
>> I noticed that psql document wrongly says that \d+ command shows
>> per-table FDW options of a foreign table, but in fact, per-table FDW
>> options are shown only in the result of \det+ command.  Attached patch
>> removes this wrong description.
>>
>> This fix should be applied to 9.1 too.
>
> I think we ought to fix the behavior, rather than the documentation.
> It's just weird to have something show up in the list view that
> doesn't appear in the detail view.

Agreed, but you might have misunderstand behavior of \d* commands,
because currently per-table options aren't shown in detail view of \d
command.  Please let me clarify the specs about FDW options in backslash
commands.

Current head shows FDW options in the result of:

      command    | shown FDW options
   --------------+-------------------
    \d (list)    | none
    \d+ (list)   | none
    \d (detail)  | per-column
    \d+ (detail) | per-column
    \det         | none
    \det+        | per-table

Note that \det doesn't have detail view.

I think showing per-table FDW options in footer of \d (not only \d+) is
reasonable because it shows per-column FDW options too.  Please see a
sample below.

postgres=# \d pgbench_accounts
       Foreign table "public.pgbench_accounts"
  Column  |     Type      | Modifiers |    Options
----------+---------------+-----------+---------------
 aid      | integer       | not null  | {colname=aid}
 bid      | integer       |           |
 abalance | integer       |           |
 filler   | character(84) |           |
Server: pgbench
Options: {nspname=public,"relname=foo bar"}

It seems fine ... but here I recall that the header "Options" is also
used for reloptions.  So it might be worth changing those headers to
"FDW Options" to avoid future conflicts.  If we do so, we would also
have to change existing headers for FDW/server/user mapping as well for
consistency, but it breaks backward compatibility.  Thoughts?

I attached WIP patch for these fixes.
Please apply show_per_table_options.patch first against head, and then
rename_desc_headers.patch can be applied.

Regards,
--
Shigeru Hanada

Attachment

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Enforcing that all WAL has been replayed after restoring from backup
Next
From: Heikki Linnakangas
Date:
Subject: Re: Compiler warnings with stringRelOpts (was WIP: Fast GiST index build)