Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 1c53f61

Browse files
committed
Escape < and & in SGML
This is not required in SGML, but will be in XML, so this is a step to prepare for the conversion to XML. (It is still not required to escape >, but we did it here in some cases for symmetry.) Add a command-line option to osx/onsgmls calls to warn about unescaped occurrences in the future. Author: Alexander Law <exclusion@gmail.com> Author: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
1 parent 8689e38 commit 1c53f61

14 files changed

+29
-26
lines changed

doc/src/sgml/Makefile

+6-3
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,13 @@ ALLSGML := $(wildcard $(srcdir)/*.sgml $(srcdir)/ref/*.sgml) $(GENERATED_SGML)
6666
# Enable some extra warnings
6767
# -wfully-tagged needed to throw a warning on missing tags
6868
# for older tool chains, 2007-08-31
69-
# Note: try "make SPFLAGS=-wxml" to catch a lot of other dubious constructs,
70-
# in particular < and & that haven't been made into entities. It's far too
71-
# noisy to turn on by default, unfortunately.
7269
override SPFLAGS += -wall -wno-unused-param -wno-empty -wfully-tagged
70+
# Additional warnings for XML compatibility. The conditional is meant
71+
# to detect whether we are using OpenSP rather than the ancient
72+
# original SP.
73+
ifneq (,$(filter o%,$(notdir $(OSX))))
74+
override SPFLAGS += -wdata-delim
75+
endif
7376

7477

7578
##

doc/src/sgml/array.sgml

+1-1
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ SELECT * FROM
654654
For instance:
655655

656656
<programlisting>
657-
SELECT * FROM sal_emp WHERE pay_by_quarter && ARRAY[10000];
657+
SELECT * FROM sal_emp WHERE pay_by_quarter &amp;&amp; ARRAY[10000];
658658
</programlisting>
659659

660660
This and other array operators are further described in

doc/src/sgml/fdwhandler.sgml

+3-3
Original file line numberDiff line numberDiff line change
@@ -696,9 +696,9 @@ IsForeignRelUpdatable (Relation rel);
696696
The return value should be a bit mask of rule event numbers indicating
697697
which operations are supported by the foreign table, using the
698698
<literal>CmdType</> enumeration; that is,
699-
<literal>(1 << CMD_UPDATE) = 4</> for <command>UPDATE</>,
700-
<literal>(1 << CMD_INSERT) = 8</> for <command>INSERT</>, and
701-
<literal>(1 << CMD_DELETE) = 16</> for <command>DELETE</>.
699+
<literal>(1 &lt;&lt; CMD_UPDATE) = 4</> for <command>UPDATE</>,
700+
<literal>(1 &lt;&lt; CMD_INSERT) = 8</> for <command>INSERT</>, and
701+
<literal>(1 &lt;&lt; CMD_DELETE) = 16</> for <command>DELETE</>.
702702
</para>
703703

704704
<para>

doc/src/sgml/plpgsql.sgml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1823,8 +1823,8 @@ $BODY$
18231823
BEGIN
18241824
RETURN QUERY SELECT flightid
18251825
FROM flight
1826-
WHERE flightdate >= $1
1827-
AND flightdate < ($1 + 1);
1826+
WHERE flightdate &gt;= $1
1827+
AND flightdate &lt; ($1 + 1);
18281828

18291829
-- Since execution is not finished, we can check whether rows were returned
18301830
-- and raise exception if not.

doc/src/sgml/ref/alter_operator.sgml

+2-2
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ ALTER OPERATOR @@ (text, text) OWNER TO joe;
134134
</programlisting></para>
135135

136136
<para>
137-
Change the restriction and join selectivity estimator functions of a custom operator <literal>a && b</literal> for type <type>int[]</type>:
137+
Change the restriction and join selectivity estimator functions of a custom operator <literal>a &amp;&amp; b</literal> for type <type>int[]</type>:
138138
<programlisting>
139-
ALTER OPERATOR && (_int4, _int4) SET (RESTRICT = _int_contsel, JOIN = _int_contjoinsel);
139+
ALTER OPERATOR &amp;&amp; (_int4, _int4) SET (RESTRICT = _int_contsel, JOIN = _int_contjoinsel);
140140
</programlisting></para>
141141

142142
</refsect1>

doc/src/sgml/ref/create_view.sgml

+1-1
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ CREATE VIEW comedies AS
466466
CREATE RECURSIVE VIEW public.nums_1_100 (n) AS
467467
VALUES (1)
468468
UNION ALL
469-
SELECT n+1 FROM nums_1_100 WHERE n < 100;
469+
SELECT n+1 FROM nums_1_100 WHERE n &lt; 100;
470470
</programlisting>
471471
Notice that although the recursive view's name is schema-qualified in this
472472
<command>CREATE</>, its internal self-reference is not schema-qualified.

doc/src/sgml/ref/pgtesttiming.sgml

+6-6
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
nanoseconds. This example from an Intel i7-860 system using a TSC clock
9595
source shows excellent performance:
9696

97-
<screen>
97+
<screen><![CDATA[
9898
Testing timing overhead for 3 seconds.
9999
Per loop time including overhead: 35.96 ns
100100
Histogram of timing durations:
@@ -104,7 +104,7 @@ Histogram of timing durations:
104104
4 0.00015 126
105105
8 0.00002 13
106106
16 0.00000 2
107-
</screen>
107+
]]></screen>
108108
</para>
109109

110110
<para>
@@ -152,7 +152,7 @@ EXPLAIN ANALYZE SELECT COUNT(*) FROM t;
152152
possible from switching to the slower acpi_pm time source, on the same
153153
system used for the fast results above:
154154

155-
<screen>
155+
<screen><![CDATA[
156156
# cat /sys/devices/system/clocksource/clocksource0/available_clocksource
157157
tsc hpet acpi_pm
158158
# echo acpi_pm > /sys/devices/system/clocksource/clocksource0/current_clocksource
@@ -165,7 +165,7 @@ Histogram of timing durations:
165165
4 0.07810 3241
166166
8 0.01357 563
167167
16 0.00007 3
168-
</screen>
168+
]]></screen>
169169
</para>
170170

171171
<para>
@@ -201,7 +201,7 @@ kern.timecounter.hardware: ACPI-fast -> TSC
201201
implementation, which can have good resolution when it's backed by fast
202202
enough timing hardware, as in this example:
203203

204-
<screen>
204+
<screen><![CDATA[
205205
$ cat /sys/devices/system/clocksource/clocksource0/available_clocksource
206206
jiffies
207207
$ dmesg | grep time.c
@@ -218,7 +218,7 @@ Histogram of timing durations:
218218
8 0.00007 22
219219
16 0.00000 1
220220
32 0.00000 1
221-
</screen></para>
221+
]]></screen></para>
222222

223223
</refsect2>
224224

doc/src/sgml/release-8.4.sgml

+1-1
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@
962962
to fix all pre-existing data errors. However, an installation can be
963963
presumed safe after performing this vacuuming if it has executed fewer
964964
than 2^31 update transactions in its lifetime (check this with
965-
<literal>SELECT txid_current() < 2^31</>).
965+
<literal>SELECT txid_current() &lt; 2^31</>).
966966
</para>
967967
</listitem>
968968

doc/src/sgml/release-9.0.sgml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2900,7 +2900,7 @@
29002900
to fix all pre-existing data errors. However, an installation can be
29012901
presumed safe after performing this vacuuming if it has executed fewer
29022902
than 2^31 update transactions in its lifetime (check this with
2903-
<literal>SELECT txid_current() < 2^31</>).
2903+
<literal>SELECT txid_current() &lt; 2^31</>).
29042904
</para>
29052905
</listitem>
29062906

doc/src/sgml/release-9.1.sgml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4654,7 +4654,7 @@ Branch: REL9_0_STABLE [9d6af7367] 2015-08-15 11:02:34 -0400
46544654
to fix all pre-existing data errors. However, an installation can be
46554655
presumed safe after performing this vacuuming if it has executed fewer
46564656
than 2^31 update transactions in its lifetime (check this with
4657-
<literal>SELECT txid_current() < 2^31</>).
4657+
<literal>SELECT txid_current() &lt; 2^31</>).
46584658
</para>
46594659
</listitem>
46604660

doc/src/sgml/release-9.2.sgml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6553,7 +6553,7 @@ Branch: REL9_2_STABLE [6b700301c] 2015-02-17 16:03:00 +0100
65536553
to fix all pre-existing data errors. However, an installation can be
65546554
presumed safe after performing this vacuuming if it has executed fewer
65556555
than 2^31 update transactions in its lifetime (check this with
6556-
<literal>SELECT txid_current() < 2^31</>).
6556+
<literal>SELECT txid_current() &lt; 2^31</>).
65576557
</para>
65586558
</listitem>
65596559

doc/src/sgml/release-9.3.sgml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9930,7 +9930,7 @@ Branch: REL8_4_STABLE [c0c2d62ac] 2014-02-14 21:59:56 -0500
99309930
to fix all pre-existing data errors. However, an installation can be
99319931
presumed safe after performing this vacuuming if it has executed fewer
99329932
than 2^31 update transactions in its lifetime (check this with
9933-
<literal>SELECT txid_current() < 2^31</>).
9933+
<literal>SELECT txid_current() &lt; 2^31</>).
99349934
</para>
99359935
</listitem>
99369936

doc/src/sgml/rules.sgml

+2-2
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ CREATE MATERIALIZED VIEW sales_summary AS
970970
invoice_date,
971971
sum(invoice_amt)::numeric(13,2) as sales_amt
972972
FROM invoice
973-
WHERE invoice_date < CURRENT_DATE
973+
WHERE invoice_date &lt; CURRENT_DATE
974974
GROUP BY
975975
seller_no,
976976
invoice_date
@@ -1058,7 +1058,7 @@ SELECT count(*) FROM words WHERE word = 'caterpiler';
10581058
have wanted. Again using <literal>file_fdw</literal>:
10591059

10601060
<programlisting>
1061-
SELECT word FROM words ORDER BY word <-> 'caterpiler' LIMIT 10;
1061+
SELECT word FROM words ORDER BY word &lt;-&gt; 'caterpiler' LIMIT 10;
10621062

10631063
word
10641064
---------------

doc/src/sgml/syntax.sgml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1725,7 +1725,7 @@ SELECT percentile_cont(0.5) WITHIN GROUP (ORDER BY income) FROM households;
17251725
<programlisting>
17261726
SELECT
17271727
count(*) AS unfiltered,
1728-
count(*) FILTER (WHERE i < 5) AS filtered
1728+
count(*) FILTER (WHERE i &lt; 5) AS filtered
17291729
FROM generate_series(1,10) AS s(i);
17301730
unfiltered | filtered
17311731
------------+----------

0 commit comments

Comments
 (0)