From: Peter Eisentraut Date: Wed, 6 Sep 2017 15:22:43 +0000 (-0400) Subject: Escape < and & in SGML X-Git-Tag: REL_11_BETA1~1666 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1c53f612bc8c9dbf97aa5a29910654a66dcdd307;p=postgresql 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 Author: Peter Eisentraut --- diff --git a/doc/src/sgml/Makefile b/doc/src/sgml/Makefile index 8a73cc796f..7458ef4de2 100644 --- a/doc/src/sgml/Makefile +++ b/doc/src/sgml/Makefile @@ -66,10 +66,13 @@ ALLSGML := $(wildcard $(srcdir)/*.sgml $(srcdir)/ref/*.sgml) $(GENERATED_SGML) # Enable some extra warnings # -wfully-tagged needed to throw a warning on missing tags # for older tool chains, 2007-08-31 -# Note: try "make SPFLAGS=-wxml" to catch a lot of other dubious constructs, -# in particular < and & that haven't been made into entities. It's far too -# noisy to turn on by default, unfortunately. override SPFLAGS += -wall -wno-unused-param -wno-empty -wfully-tagged +# Additional warnings for XML compatibility. The conditional is meant +# to detect whether we are using OpenSP rather than the ancient +# original SP. +ifneq (,$(filter o%,$(notdir $(OSX)))) +override SPFLAGS += -wdata-delim +endif ## diff --git a/doc/src/sgml/array.sgml b/doc/src/sgml/array.sgml index 58878451f0..dd0d20e541 100644 --- a/doc/src/sgml/array.sgml +++ b/doc/src/sgml/array.sgml @@ -654,7 +654,7 @@ SELECT * FROM For instance: -SELECT * FROM sal_emp WHERE pay_by_quarter && ARRAY[10000]; +SELECT * FROM sal_emp WHERE pay_by_quarter && ARRAY[10000]; This and other array operators are further described in diff --git a/doc/src/sgml/fdwhandler.sgml b/doc/src/sgml/fdwhandler.sgml index cfa6808417..edf1029fe6 100644 --- a/doc/src/sgml/fdwhandler.sgml +++ b/doc/src/sgml/fdwhandler.sgml @@ -696,9 +696,9 @@ IsForeignRelUpdatable (Relation rel); The return value should be a bit mask of rule event numbers indicating which operations are supported by the foreign table, using the CmdType enumeration; that is, - (1 << CMD_UPDATE) = 4 for UPDATE, - (1 << CMD_INSERT) = 8 for INSERT, and - (1 << CMD_DELETE) = 16 for DELETE. + (1 << CMD_UPDATE) = 4 for UPDATE, + (1 << CMD_INSERT) = 8 for INSERT, and + (1 << CMD_DELETE) = 16 for DELETE. diff --git a/doc/src/sgml/plpgsql.sgml b/doc/src/sgml/plpgsql.sgml index 2f166d2d59..6dc438a152 100644 --- a/doc/src/sgml/plpgsql.sgml +++ b/doc/src/sgml/plpgsql.sgml @@ -1823,8 +1823,8 @@ $BODY$ BEGIN RETURN QUERY SELECT flightid FROM flight - WHERE flightdate >= $1 - AND flightdate < ($1 + 1); + WHERE flightdate >= $1 + AND flightdate < ($1 + 1); -- Since execution is not finished, we can check whether rows were returned -- and raise exception if not. diff --git a/doc/src/sgml/ref/alter_operator.sgml b/doc/src/sgml/ref/alter_operator.sgml index b2eaa7a263..9579d00b78 100644 --- a/doc/src/sgml/ref/alter_operator.sgml +++ b/doc/src/sgml/ref/alter_operator.sgml @@ -134,9 +134,9 @@ ALTER OPERATOR @@ (text, text) OWNER TO joe; - Change the restriction and join selectivity estimator functions of a custom operator a && b for type int[]: + Change the restriction and join selectivity estimator functions of a custom operator a && b for type int[]: -ALTER OPERATOR && (_int4, _int4) SET (RESTRICT = _int_contsel, JOIN = _int_contjoinsel); +ALTER OPERATOR && (_int4, _int4) SET (RESTRICT = _int_contsel, JOIN = _int_contjoinsel); diff --git a/doc/src/sgml/ref/create_view.sgml b/doc/src/sgml/ref/create_view.sgml index a83d9564e5..319335051b 100644 --- a/doc/src/sgml/ref/create_view.sgml +++ b/doc/src/sgml/ref/create_view.sgml @@ -466,7 +466,7 @@ CREATE VIEW comedies AS CREATE RECURSIVE VIEW public.nums_1_100 (n) AS VALUES (1) UNION ALL - SELECT n+1 FROM nums_1_100 WHERE n < 100; + SELECT n+1 FROM nums_1_100 WHERE n < 100; Notice that although the recursive view's name is schema-qualified in this CREATE, its internal self-reference is not schema-qualified. diff --git a/doc/src/sgml/ref/pgtesttiming.sgml b/doc/src/sgml/ref/pgtesttiming.sgml index e3539cf764..c659101361 100644 --- a/doc/src/sgml/ref/pgtesttiming.sgml +++ b/doc/src/sgml/ref/pgtesttiming.sgml @@ -94,7 +94,7 @@ nanoseconds. This example from an Intel i7-860 system using a TSC clock source shows excellent performance: - + +]]> @@ -152,7 +152,7 @@ EXPLAIN ANALYZE SELECT COUNT(*) FROM t; possible from switching to the slower acpi_pm time source, on the same system used for the fast results above: - + /sys/devices/system/clocksource/clocksource0/current_clocksource @@ -165,7 +165,7 @@ Histogram of timing durations: 4 0.07810 3241 8 0.01357 563 16 0.00007 3 - +]]> @@ -201,7 +201,7 @@ kern.timecounter.hardware: ACPI-fast -> TSC implementation, which can have good resolution when it's backed by fast enough timing hardware, as in this example: - + +]]> diff --git a/doc/src/sgml/release-8.4.sgml b/doc/src/sgml/release-8.4.sgml index 16004edb74..53e319ff33 100644 --- a/doc/src/sgml/release-8.4.sgml +++ b/doc/src/sgml/release-8.4.sgml @@ -962,7 +962,7 @@ to fix all pre-existing data errors. However, an installation can be presumed safe after performing this vacuuming if it has executed fewer than 2^31 update transactions in its lifetime (check this with - SELECT txid_current() < 2^31). + SELECT txid_current() < 2^31). diff --git a/doc/src/sgml/release-9.0.sgml b/doc/src/sgml/release-9.0.sgml index e7d2ffddaf..f7c63fc567 100644 --- a/doc/src/sgml/release-9.0.sgml +++ b/doc/src/sgml/release-9.0.sgml @@ -2900,7 +2900,7 @@ to fix all pre-existing data errors. However, an installation can be presumed safe after performing this vacuuming if it has executed fewer than 2^31 update transactions in its lifetime (check this with - SELECT txid_current() < 2^31). + SELECT txid_current() < 2^31). diff --git a/doc/src/sgml/release-9.1.sgml b/doc/src/sgml/release-9.1.sgml index 0454f849d4..c354b7d1bc 100644 --- a/doc/src/sgml/release-9.1.sgml +++ b/doc/src/sgml/release-9.1.sgml @@ -4654,7 +4654,7 @@ Branch: REL9_0_STABLE [9d6af7367] 2015-08-15 11:02:34 -0400 to fix all pre-existing data errors. However, an installation can be presumed safe after performing this vacuuming if it has executed fewer than 2^31 update transactions in its lifetime (check this with - SELECT txid_current() < 2^31). + SELECT txid_current() < 2^31). diff --git a/doc/src/sgml/release-9.2.sgml b/doc/src/sgml/release-9.2.sgml index 57a8e93b43..faa7ae4d57 100644 --- a/doc/src/sgml/release-9.2.sgml +++ b/doc/src/sgml/release-9.2.sgml @@ -6553,7 +6553,7 @@ Branch: REL9_2_STABLE [6b700301c] 2015-02-17 16:03:00 +0100 to fix all pre-existing data errors. However, an installation can be presumed safe after performing this vacuuming if it has executed fewer than 2^31 update transactions in its lifetime (check this with - SELECT txid_current() < 2^31). + SELECT txid_current() < 2^31). diff --git a/doc/src/sgml/release-9.3.sgml b/doc/src/sgml/release-9.3.sgml index 2ad5dee09c..f3b00a70d5 100644 --- a/doc/src/sgml/release-9.3.sgml +++ b/doc/src/sgml/release-9.3.sgml @@ -9930,7 +9930,7 @@ Branch: REL8_4_STABLE [c0c2d62ac] 2014-02-14 21:59:56 -0500 to fix all pre-existing data errors. However, an installation can be presumed safe after performing this vacuuming if it has executed fewer than 2^31 update transactions in its lifetime (check this with - SELECT txid_current() < 2^31). + SELECT txid_current() < 2^31). diff --git a/doc/src/sgml/rules.sgml b/doc/src/sgml/rules.sgml index bcbc170335..61423c25ef 100644 --- a/doc/src/sgml/rules.sgml +++ b/doc/src/sgml/rules.sgml @@ -970,7 +970,7 @@ CREATE MATERIALIZED VIEW sales_summary AS invoice_date, sum(invoice_amt)::numeric(13,2) as sales_amt FROM invoice - WHERE invoice_date < CURRENT_DATE + WHERE invoice_date < CURRENT_DATE GROUP BY seller_no, invoice_date @@ -1058,7 +1058,7 @@ SELECT count(*) FROM words WHERE word = 'caterpiler'; have wanted. Again using file_fdw: -SELECT word FROM words ORDER BY word <-> 'caterpiler' LIMIT 10; +SELECT word FROM words ORDER BY word <-> 'caterpiler' LIMIT 10; word --------------- diff --git a/doc/src/sgml/syntax.sgml b/doc/src/sgml/syntax.sgml index a2d136eaf8..06f0f0b8e0 100644 --- a/doc/src/sgml/syntax.sgml +++ b/doc/src/sgml/syntax.sgml @@ -1725,7 +1725,7 @@ SELECT percentile_cont(0.5) WITHIN GROUP (ORDER BY income) FROM households; SELECT count(*) AS unfiltered, - count(*) FILTER (WHERE i < 5) AS filtered + count(*) FILTER (WHERE i < 5) AS filtered FROM generate_series(1,10) AS s(i); unfiltered | filtered ------------+----------