# 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:
-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
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>.
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.
- 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);
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.
nanoseconds. This example from an Intel i7-860 system using a TSC clock
source shows excellent performance:
-
+
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
-
+]]>
possible from switching to the slower acpi_pm time source, on the same
system used for the fast results above:
-
+
# 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
-
+]]>
implementation, which can have good resolution when it's backed by fast
enough timing hardware, as in this example:
-
+
$ 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
-
+]]>
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>).
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>).
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>).
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>).
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>).
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 file_fdw:
-SELECT word FROM words ORDER BY word <-> 'caterpiler' LIMIT 10;
+SELECT word FROM words ORDER BY word <-> 'caterpiler' LIMIT 10;
word
---------------
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
------------+----------