Skip to content

Commit 60c90c1

Browse files
committed
Doc: fix "Unresolved ID reference" warnings, clean up man page cross-refs.
Use xreflabel attributes instead of endterm attributes to control the appearance of links to subsections of SQL command reference pages. This is simpler, it matches what we do elsewhere (e.g. for GUC variables), and it doesn't draw "Unresolved ID reference" warnings from the PDF toolchain. Fix some places where the text was absolutely dependent on an <xref> rendering exactly so, by using a <link> around the required text instead. At least one of those spots had already been turned into bad grammar by subsequent changes, and the whole idea is just too fragile for my taste. <xref> does NOT have fixed output, don't write as if it does. Consistently include a page-level link in cross-man-page references, because otherwise they are useless/nonsensical in man-page output. Likewise, be consistent about mentioning "below" or "above" in same-page references; we were doing that in about 90% of the cases, but now it's 100%. Also get rid of another nonfunctional-in-PDF idea, of making cross-references to functions by sticking ID tags on <row> constructs. We can put the IDs on <indexterm>s instead --- which is probably not any more sensible in abstract terms, but it works where the other doesn't. (There is talk of attaching cross-reference IDs to most or all of the docs' function descriptions, but for now I just fixed the two that exist.) Discussion: https://postgr.es/m/[email protected]
1 parent 624686a commit 60c90c1

26 files changed

+167
-193
lines changed

doc/src/sgml/config.sgml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7301,8 +7301,7 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
73017301
These settings control the behavior of the <firstterm>autovacuum</firstterm>
73027302
feature. Refer to <xref linkend="autovacuum"/> for more information.
73037303
Note that many of these settings can be overridden on a per-table
7304-
basis; see <xref linkend="sql-createtable-storage-parameters"
7305-
endterm="sql-createtable-storage-parameters-title"/>.
7304+
basis; see <xref linkend="sql-createtable-storage-parameters"/>.
73067305
</para>
73077306

73087307
<variablelist>

doc/src/sgml/func.sgml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4355,9 +4355,9 @@ SELECT format('Testing %3$s, %2$s, %s', 'one', 'two', 'three');
43554355
</para></entry>
43564356
</row>
43574357

4358-
<row id="function-encode">
4358+
<row>
43594359
<entry role="func_table_entry"><para role="func_signature">
4360-
<indexterm>
4360+
<indexterm id="function-encode">
43614361
<primary>encode</primary>
43624362
</indexterm>
43634363
<function>encode</function> ( <parameter>bytes</parameter> <type>bytea</type>,
@@ -4377,9 +4377,9 @@ SELECT format('Testing %3$s, %2$s, %s', 'one', 'two', 'three');
43774377
</para></entry>
43784378
</row>
43794379

4380-
<row id="function-decode">
4380+
<row>
43814381
<entry role="func_table_entry"><para role="func_signature">
4382-
<indexterm>
4382+
<indexterm id="function-decode">
43834383
<primary>decode</primary>
43844384
</indexterm>
43854385
<function>decode</function> ( <parameter>string</parameter> <type>text</type>,

doc/src/sgml/indices.sgml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ CREATE INDEX test1_id_index ON test1 (id);
9898
In production environments this is often unacceptable.
9999
It is possible to allow writes to occur in parallel with index
100100
creation, but there are several caveats to be aware of &mdash;
101-
for more information see <xref linkend="sql-createindex-concurrently"
102-
endterm="sql-createindex-concurrently-title"/>.
101+
for more information see <xref linkend="sql-createindex-concurrently"/>.
103102
</para>
104103

105104
<para>

doc/src/sgml/maintenance.sgml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -827,8 +827,7 @@ analyze threshold = analyze base threshold + analyze scale factor * number of tu
827827
The default thresholds and scale factors are taken from
828828
<filename>postgresql.conf</filename>, but it is possible to override them
829829
(and many other autovacuum control parameters) on a per-table basis; see
830-
<xref linkend="sql-createtable-storage-parameters"
831-
endterm="sql-createtable-storage-parameters-title"/> for more information.
830+
<xref linkend="sql-createtable-storage-parameters"/> for more information.
832831
If a setting has been changed via a table's storage parameters, that value
833832
is used when processing that table; otherwise the global settings are
834833
used. See <xref linkend="runtime-config-autovacuum"/> for more details on

doc/src/sgml/queries.sgml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ SELECT random();
110110
<title>The <literal>FROM</literal> Clause</title>
111111

112112
<para>
113-
The <xref linkend="sql-from" endterm="sql-from-title"/> derives a
113+
The <link linkend="sql-from"><literal>FROM</literal></link> clause derives a
114114
table from one or more other tables given in a comma-separated
115115
table reference list.
116116
<synopsis>
@@ -907,8 +907,8 @@ WHERE pname IS NULL;
907907
</indexterm>
908908

909909
<para>
910-
The syntax of the <xref linkend="sql-where"
911-
endterm="sql-where-title"/> is
910+
The syntax of the <link linkend="sql-where"><literal>WHERE</literal></link>
911+
clause is
912912
<synopsis>
913913
WHERE <replaceable>search_condition</replaceable>
914914
</synopsis>
@@ -1014,7 +1014,7 @@ SELECT <replaceable>select_list</replaceable>
10141014
</synopsis>
10151015

10161016
<para>
1017-
The <xref linkend="sql-groupby" endterm="sql-groupby-title"/> is
1017+
The <link linkend="sql-groupby"><literal>GROUP BY</literal></link> clause is
10181018
used to group together those rows in a table that have the same
10191019
values in all the columns listed. The order in which the columns
10201020
are listed does not matter. The effect is to combine each set

doc/src/sgml/ref/alter_collation.sgml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,15 @@ ALTER COLLATION <replaceable>name</replaceable> SET SCHEMA <replaceable>new_sche
9393
<listitem>
9494
<para>
9595
Update the collation's version.
96-
See <xref linkend="sql-altercollation-notes"
97-
endterm="sql-altercollation-notes-title"/> below.
96+
See <xref linkend="sql-altercollation-notes"/> below.
9897
</para>
9998
</listitem>
10099
</varlistentry>
101100
</variablelist>
102101
</refsect1>
103102

104-
<refsect1 id="sql-altercollation-notes">
105-
<title id="sql-altercollation-notes-title">Notes</title>
103+
<refsect1 id="sql-altercollation-notes" xreflabel="Notes">
104+
<title>Notes</title>
106105

107106
<para>
108107
When using collations provided by the ICU library, the ICU-specific version

doc/src/sgml/ref/alter_table.sgml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
405405
database will not assume that the constraint holds for all rows in
406406
the table, until it is validated by using the <literal>VALIDATE
407407
CONSTRAINT</literal> option.
408-
See <xref linkend="sql-altertable-notes"
409-
endterm="sql-altertable-notes-title"/> below for more information
408+
See <xref linkend="sql-altertable-notes"/> below for more information
410409
about using the <literal>NOT VALID</literal> option.
411410
</para>
412411

@@ -504,9 +503,8 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
504503
previously created as <literal>NOT VALID</literal>, by scanning the
505504
table to ensure there are no rows for which the constraint is not
506505
satisfied. Nothing happens if the constraint is already marked valid.
507-
(See <xref linkend="sql-altertable-notes"
508-
endterm="sql-altertable-notes-title"/> below for an explanation of the
509-
usefulness of this command.)
506+
(See <xref linkend="sql-altertable-notes"/> below for an explanation
507+
of the usefulness of this command.)
510508
</para>
511509
</listitem>
512510
</varlistentry>
@@ -708,8 +706,8 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
708706
<listitem>
709707
<para>
710708
This form changes one or more storage parameters for the table. See
711-
<xref linkend="sql-createtable-storage-parameters"
712-
endterm="sql-createtable-storage-parameters-title"/>
709+
<xref linkend="sql-createtable-storage-parameters"/> in the
710+
<xref linkend="sql-createtable"/> documentation
713711
for details on the available parameters. Note that the table contents
714712
will not be modified immediately by this command; depending on the
715713
parameter you might need to rewrite the table to get the desired effects.
@@ -1210,8 +1208,8 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
12101208
</variablelist>
12111209
</refsect1>
12121210

1213-
<refsect1 id="sql-altertable-notes">
1214-
<title id="sql-altertable-notes-title">Notes</title>
1211+
<refsect1 id="sql-altertable-notes" xreflabel="Notes">
1212+
<title>Notes</title>
12151213

12161214
<para>
12171215
The key word <literal>COLUMN</literal> is noise and can be omitted.

doc/src/sgml/ref/create_aggregate.sgml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,8 @@ SELECT col FROM tab ORDER BY col USING sortop LIMIT 1;
434434
This option specifies whether the final function is a pure function
435435
that does not modify its arguments. <literal>READ_ONLY</literal> indicates
436436
it does not; the other two values indicate that it may change the
437-
transition state value. See <xref linkend="sql-createaggregate-notes"
438-
endterm="sql-createaggregate-notes-title"/> below for more detail. The
437+
transition state value. See <xref linkend="sql-createaggregate-notes"/>
438+
below for more detail. The
439439
default is <literal>READ_ONLY</literal>, except for ordered-set aggregates,
440440
for which the default is <literal>READ_WRITE</literal>.
441441
</para>
@@ -664,8 +664,8 @@ SELECT col FROM tab ORDER BY col USING sortop LIMIT 1;
664664
</para>
665665
</refsect1>
666666

667-
<refsect1 id="sql-createaggregate-notes">
668-
<title id="sql-createaggregate-notes-title">Notes</title>
667+
<refsect1 id="sql-createaggregate-notes" xreflabel="Notes">
668+
<title>Notes</title>
669669

670670
<para>
671671
In parameters that specify support function names, you can write

doc/src/sgml/ref/create_index.sgml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] <replaceable class=
126126
updates, or deletes on the table; whereas a standard index build
127127
locks out writes (but not reads) on the table until it's done.
128128
There are several caveats to be aware of when using this option
129-
&mdash; see <xref linkend="sql-createindex-concurrently"
130-
endterm="sql-createindex-concurrently-title"/>.
129+
&mdash; see <xref linkend="sql-createindex-concurrently"/> below.
131130
</para>
132131
<para>
133132
For temporary tables, <command>CREATE INDEX</command> is always
@@ -337,7 +336,7 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] <replaceable class=
337336
<listitem>
338337
<para>
339338
The name of an index-method-specific storage parameter. See
340-
<xref linkend="sql-createindex-storage-parameters" endterm="sql-createindex-storage-parameters-title"/>
339+
<xref linkend="sql-createindex-storage-parameters"/> below
341340
for details.
342341
</para>
343342
</listitem>
@@ -366,8 +365,8 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] <replaceable class=
366365

367366
</variablelist>
368367

369-
<refsect2 id="sql-createindex-storage-parameters">
370-
<title id="sql-createindex-storage-parameters-title">Index Storage Parameters</title>
368+
<refsect2 id="sql-createindex-storage-parameters" xreflabel="Index Storage Parameters">
369+
<title>Index Storage Parameters</title>
371370

372371
<para>
373372
The optional <literal>WITH</literal> clause specifies <firstterm>storage
@@ -559,8 +558,8 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] <replaceable class=
559558
</variablelist>
560559
</refsect2>
561560

562-
<refsect2 id="sql-createindex-concurrently">
563-
<title id="sql-createindex-concurrently-title">Building Indexes Concurrently</title>
561+
<refsect2 id="sql-createindex-concurrently" xreflabel="Building Indexes Concurrently">
562+
<title>Building Indexes Concurrently</title>
564563

565564
<indexterm zone="sql-createindex-concurrently">
566565
<primary>index</primary>
@@ -688,7 +687,7 @@ Indexes:
688687
</para>
689688

690689
<para>
691-
An <firstterm>operator class</firstterm> with its optional parameters
690+
An <firstterm>operator class</firstterm> with optional parameters
692691
can be specified for each column of an index.
693692
The operator class identifies the operators to be
694693
used by the index for that column. For example, a B-tree index on

doc/src/sgml/ref/create_materialized_view.sgml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,9 @@ CREATE MATERIALIZED VIEW [ IF NOT EXISTS ] <replaceable>table_name</replaceable>
106106
<listitem>
107107
<para>
108108
This clause specifies optional storage parameters for the new
109-
materialized view; see <xref linkend="sql-createtable-storage-parameters"
110-
endterm="sql-createtable-storage-parameters-title"/> for more
109+
materialized view; see
110+
<xref linkend="sql-createtable-storage-parameters"/> in the
111+
<xref linkend="sql-createtable"/> documentation for more
111112
information. All parameters supported for <literal>CREATE
112113
TABLE</literal> are also supported for <literal>CREATE MATERIALIZED
113114
VIEW</literal>.

0 commit comments

Comments
 (0)