postgres.git / summary / log / commit / refs

commit    4272618fbb83f1522e68626f70f0dee4628b73f2
Author:   Fujii Masao <fujii@postgresql.org>
Date:     Wed Oct 21 14:37:38 2026 +0000
First released in: 18.7, 19.0

    doc: Correct psql's \d+x documentation for sequences
    
    Commit 00f4c2959d6 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


doc/src/sgml/ref/psql-ref.sgml | 11 +++++++---- src/bin/psql/help.c | 3 ++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index f945c9f394b..66122bcb4ca 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -1340,10 +1340,13 @@ SELECT $1 \parse stmt1 </para> <para> As with many other commands, if <literal>x</literal> is appended to - the command name, the results are displayed in expanded mode, but note - that this only applies when <command>\d</command> is used without a - <replaceable class="parameter">pattern</replaceable> argument, and - the <literal>x</literal> modifier cannot appear immediately after the + the command name, the results are displayed in expanded mode for this + command only, but note that this only applies when <command>\d</command> + is used without a <replaceable class="parameter">pattern</replaceable> + 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); the <literal>x</literal> modifier may only appear after an <literal>S</literal> or <literal>+</literal> modifier. For example, diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c index 9c15cb679fd..84d052e4780 100644 --- a/src/bin/psql/help.c +++ b/src/bin/psql/help.c @@ -220,7 +220,8 @@ slashUsage(unsigned short int pager) HELP0("Informational\n"); HELP0(" (options: S = show system objects, x = expanded mode, + = additional detail)\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[x+] [PATTERN] list access methods\n"); HELP0(" \\dAc[x+] [AMPTRN [TYPEPTRN]] list operator classes\n"); [parent: f6642a97fe9c]