identifies a column whose values must be integer numbers, and the
values from <replaceable class="parameter">colH</replaceable> will
appear in the horizontal header sorted according to the
corresponding <replaceable class="parameter">sortcolH</replaceable> values.
</para>
<para>
Inside the crosstab grid, for each distinct value <literal>x</literal>
of <replaceable class="parameter">colH</replaceable> and each distinct
value <literal>y</literal>
of <replaceable class="parameter">colV</replaceable>, the cell located
at the intersection <literal>(x,y)</literal> contains the value of
the <literal>colD</literal> column in the query result row for which
the value of <replaceable class="parameter">colH</replaceable>
is <literal>x</literal> and the value
of <replaceable class="parameter">colV</replaceable>
is <literal>y</literal>. If there is no such row, the cell is empty. If
there are multiple such rows, an error is reported.
</para>
</listitem>
</varlistentry>
<varlistentry id="app-psql-meta-command-d">
<term><literal>\d[Sx+] [ <link linkend="app-psql-patterns"><replaceable class="parameter">pattern</replaceable></link> ]</literal></term>
<listitem>
<para>
For each relation (table, view, materialized view, index, sequence,
or foreign table)
or composite type matching the
<replaceable class="parameter">pattern</replaceable>, show all
columns, their types, the tablespace (if not the default) and any
special attributes such as <literal>NOT NULL</literal> or defaults.
Associated indexes, constraints, rules, and triggers are
also shown. For foreign tables, the associated foreign
server is shown as well.
(<quote>Matching the pattern</quote> is defined in
<xref linkend="app-psql-patterns"/> below.)
</para>
<para>
For some types of relation, <literal>\d</literal> shows additional information
for each column: column values for sequences, indexed expressions for
indexes, and foreign data wrapper options for foreign tables.
</para>
<para>
The command form <literal>\d+</literal> is identical, except that
more information is displayed: any comments associated with the
columns of the table are shown, as is the presence of OIDs in the
table, the view definition if the relation is a view, a non-default
<link linkend="sql-altertable-replica-identity">replica
identity</link> setting and the
<link linkend="sql-create-access-method">access method</link> name
if the relation has an access method.
</para>
<para>
By default, only user-created objects are shown; supply a
pattern or the <literal>S</literal> modifier to include system
objects.
</para>
<note>
<para>
If <command>\d</command> is used without a
<replaceable class="parameter">pattern</replaceable> argument, it is
equivalent to <command>\dtvmsE</command> which will show a list of
all visible tables, views, materialized views, sequences and
foreign tables.
This is purely a convenience measure.
</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
<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>