1
0
mirror of https://github.com/postgres/postgres.git synced 2026-10-23 13:29:09 +03:00

doc: Correct psql's \d+x documentation for sequences

Commit 00f4c2959d added the x modifier to psql's list commands, making
\d+x display sequence descriptions in expanded mode. However, the
documentation and \? help indicate that x applies only without a pattern.

Clarify that \d+x also uses expanded mode when describing sequences
matched by a name or pattern, and update the command help accordingly.
Also clarify that the same restriction applies to \x on and \x auto.

Backpatch to v18, where the x modifier was introduced.

Reported-by: George MacKerron <george.mackerron@databricks.com>
Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Shihao Zhong <zhong950419@gmail.com>
Discussion: https://postgr.es/m/FEA91EA9-CF32-4920-9674-F2C3E01C3807@databricks.com
Backpatch-through: 18
This commit is contained in:
Fujii Masao
2026-10-21 23:37:38 +09:00
parent f6642a97fe
commit 4272618fbb
2 changed files with 9 additions and 5 deletions

View File

@@ -1340,10 +1340,13 @@ SELECT $1 \parse stmt1
</para> </para>
<para> <para>
As with many other commands, if <literal>x</literal> is appended to As with many other commands, if <literal>x</literal> is appended to
the command name, the results are displayed in expanded mode, but note the command name, the results are displayed in expanded mode for this
that this only applies when <command>\d</command> is used without a command only, but note that this only applies when <command>\d</command>
<replaceable class="parameter">pattern</replaceable> argument, and is used without a <replaceable class="parameter">pattern</replaceable>
the <literal>x</literal> modifier cannot appear immediately after the argument or to describe a sequence.
The same limitation on expanded output applies to
<command>\x on</command> and <command>\x auto</command>.
The <literal>x</literal> modifier cannot appear immediately after the
<command>\d</command> (because <command>\dx</command> is a different <command>\d</command> (because <command>\dx</command> is a different
command); the <literal>x</literal> modifier may only appear after an command); the <literal>x</literal> modifier may only appear after an
<literal>S</literal> or <literal>+</literal> modifier. For example, <literal>S</literal> or <literal>+</literal> modifier. For example,

View File

@@ -220,7 +220,8 @@ slashUsage(unsigned short int pager)
HELP0("Informational\n"); HELP0("Informational\n");
HELP0(" (options: S = show system objects, x = expanded mode, + = additional detail)\n"); HELP0(" (options: S = show system objects, x = expanded mode, + = additional detail)\n");
HELP0(" \\d[Sx+] list tables, views, and sequences\n"); HELP0(" \\d[Sx+] list tables, views, and sequences\n");
HELP0(" \\d[S+] NAME describe table, view, sequence, or index\n"); HELP0(" \\d[Sx+] NAME describe table, view, sequence, or index\n");
HELP0(" (x applies only to sequences)\n");
HELP0(" \\da[Sx] [PATTERN] list aggregates\n"); HELP0(" \\da[Sx] [PATTERN] list aggregates\n");
HELP0(" \\dA[x+] [PATTERN] list access methods\n"); HELP0(" \\dA[x+] [PATTERN] list access methods\n");
HELP0(" \\dAc[x+] [AMPTRN [TYPEPTRN]] list operator classes\n"); HELP0(" \\dAc[x+] [AMPTRN [TYPEPTRN]] list operator classes\n");