# 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
##
For instance:
<programlisting>
-SELECT * FROM sal_emp WHERE pay_by_quarter && ARRAY[10000];
+SELECT * FROM sal_emp WHERE pay_by_quarter && ARRAY[10000];
</programlisting>
This and other array operators are further described in
The return value should be a bit mask of rule event numbers indicating
which operations are supported by the foreign table, using the
<literal>CmdType</> enumeration; that is,
- <literal>(1 << CMD_UPDATE) = 4</> for <command>UPDATE</>,
- <literal>(1 << CMD_INSERT) = 8</> for <command>INSERT</>, and
- <literal>(1 << CMD_DELETE) = 16</> for <command>DELETE</>.
+ <literal>(1 << CMD_UPDATE) = 4</> for <command>UPDATE</>,
+ <literal>(1 << CMD_INSERT) = 8</> for <command>INSERT</>, and
+ <literal>(1 << CMD_DELETE) = 16</> for <command>DELETE</>.
</para>
<para>
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.
</programlisting></para>
<para>
- Change the restriction and join selectivity estimator functions of a custom operator <literal>a && b</literal> for type <type>int[]</type>:
+ Change the restriction and join selectivity estimator functions of a custom operator <literal>a && b</literal> for type <type>int[]</type>:
<programlisting>
-ALTER OPERATOR && (_int4, _int4) SET (RESTRICT = _int_contsel, JOIN = _int_contjoinsel);
+ALTER OPERATOR && (_int4, _int4) SET (RESTRICT = _int_contsel, JOIN = _int_contjoinsel);
</programlisting></para>
</refsect1>
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;
</programlisting>
Notice that although the recursive view's name is schema-qualified in this
<command>CREATE</>, its internal self-reference is not schema-qualified.
nanoseconds. This example from an Intel i7-860 system using a TSC clock
source shows excellent performance:
-<screen>
+<screen><![CDATA[
Testing timing overhead for 3 seconds.
Per loop time including overhead: 35.96 ns
Histogram of timing durations:
4 0.00015 126
8 0.00002 13
16 0.00000 2
-</screen>
+]]></screen>
</para>
<para>
possible from switching to the slower acpi_pm time source, on the same
system used for the fast results above:
-<screen>
+<screen><![CDATA[
# cat /sys/devices/system/clocksource/clocksource0/available_clocksource
tsc hpet acpi_pm
# echo acpi_pm > /sys/devices/system/clocksource/clocksource0/current_clocksource
4 0.07810 3241
8 0.01357 563
16 0.00007 3
-</screen>
+]]></screen>
</para>
<para>
implementation, which can have good resolution when it's backed by fast
enough timing hardware, as in this example:
-<screen>
+<screen><![CDATA[
$ cat /sys/devices/system/clocksource/clocksource0/available_clocksource
jiffies
$ dmesg | grep time.c
8 0.00007 22
16 0.00000 1
32 0.00000 1
-</screen></para>
+]]></screen></para>
</refsect2>
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
- <literal>SELECT txid_current() < 2^31</>).
+ <literal>SELECT txid_current() < 2^31</>).
</para>
</listitem>
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
- <literal>SELECT txid_current() < 2^31</>).
+ <literal>SELECT txid_current() < 2^31</>).
</para>
</listitem>
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
- <literal>SELECT txid_current() < 2^31</>).
+ <literal>SELECT txid_current() < 2^31</>).
</para>
</listitem>
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
- <literal>SELECT txid_current() < 2^31</>).
+ <literal>SELECT txid_current() < 2^31</>).
</para>
</listitem>
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
- <literal>SELECT txid_current() < 2^31</>).
+ <literal>SELECT txid_current() < 2^31</>).
</para>
</listitem>
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
have wanted. Again using <literal>file_fdw</literal>:
<programlisting>
-SELECT word FROM words ORDER BY word <-> 'caterpiler' LIMIT 10;
+SELECT word FROM words ORDER BY word <-> 'caterpiler' LIMIT 10;
word
---------------
<programlisting>
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
------------+----------