From f6d1d8497f2624fd17f1f539b4abd926fdbc4c2a Mon Sep 17 00:00:00 2001 From: "Anton A. Melnikov" Date: Wed, 12 Feb 2025 02:26:37 +0300 Subject: [PATCH 1/4] PGPRO-12044; PGPRO-11987: Temporary disable some rum tests. To be solved in PGPRO-11987. Tags: rum --- Makefile | 2 ++ expected/tmp.out | 34 ++++++++++++++++++++++++++++++++++ sql/tmp.sql | 42 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 expected/tmp.out create mode 100644 sql/tmp.sql diff --git a/Makefile b/Makefile index cca576da85..bc1b83349b 100644 --- a/Makefile +++ b/Makefile @@ -52,6 +52,8 @@ else REGRESS += array endif +REGRESS := security tmp $(filter-out security rum rum_hash orderby orderby_hash text array, $(REGRESS)) + # For 9.6-11 we have to make specific target with tap tests ifeq ($(MAJORVERSION), $(filter 9.6% 10% 11%, $(MAJORVERSION))) wal-check: temp-install diff --git a/expected/tmp.out b/expected/tmp.out new file mode 100644 index 0000000000..232f1b7c97 --- /dev/null +++ b/expected/tmp.out @@ -0,0 +1,34 @@ +CREATE EXTENSION rum; +CREATE TABLE test_rum( t text, a tsvector ); +CREATE TRIGGER tsvectorupdate +BEFORE UPDATE OR INSERT ON test_rum +FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('a', 'pg_catalog.english', 't'); +CREATE INDEX rumidx ON test_rum USING rum (a rum_tsvector_ops); +-- Check empty table using index scan +SELECT + a <=> to_tsquery('pg_catalog.english', 'way & (go | half)'), + rum_ts_distance(a, to_tsquery('pg_catalog.english', 'way & (go | half)')), + rum_ts_score(a, to_tsquery('pg_catalog.english', 'way & (go | half)')), + * + FROM test_rum + ORDER BY a <=> to_tsquery('pg_catalog.english', 'way & (go | half)') limit 2; + ?column? | rum_ts_distance | rum_ts_score | t | a +----------+-----------------+--------------+---+--- +(0 rows) + +-- Fill the table with data +\copy test_rum(t) from 'data/rum.data'; +CREATE INDEX failed_rumidx ON test_rum USING rum (a rum_tsvector_addon_ops); +ERROR: additional information attribute "a" is not found in index +CREATE TABLE tsts (id int, t tsvector, d timestamp); +\copy tsts from 'data/tsts.data' +CREATE INDEX tsts_idx ON tsts USING rum (t rum_tsvector_addon_ops, d) + WITH (attach = 'd', to = 't'); +INSERT INTO tsts VALUES (-1, 't1 t2', '2016-05-02 02:24:22.326724'); +INSERT INTO tsts VALUES (-2, 't1 t2 t3', '2016-05-02 02:26:22.326724'); +INSERT INTO test_rum (t) VALUES ('foo bar foo the over foo qq bar'); +INSERT INTO test_rum (t) VALUES ('345 qwerty copyright'); +INSERT INTO test_rum (t) VALUES ('345 qwerty'); +INSERT INTO test_rum (t) VALUES ('A fat cat has just eaten a rat.'); +SET enable_seqscan=off; +SET enable_indexscan=off; diff --git a/sql/tmp.sql b/sql/tmp.sql new file mode 100644 index 0000000000..76625044e9 --- /dev/null +++ b/sql/tmp.sql @@ -0,0 +1,42 @@ +CREATE EXTENSION rum; + +CREATE TABLE test_rum( t text, a tsvector ); + +CREATE TRIGGER tsvectorupdate +BEFORE UPDATE OR INSERT ON test_rum +FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('a', 'pg_catalog.english', 't'); +CREATE INDEX rumidx ON test_rum USING rum (a rum_tsvector_ops); + +-- Check empty table using index scan +SELECT + a <=> to_tsquery('pg_catalog.english', 'way & (go | half)'), + rum_ts_distance(a, to_tsquery('pg_catalog.english', 'way & (go | half)')), + rum_ts_score(a, to_tsquery('pg_catalog.english', 'way & (go | half)')), + * + FROM test_rum + ORDER BY a <=> to_tsquery('pg_catalog.english', 'way & (go | half)') limit 2; + +-- Fill the table with data +\copy test_rum(t) from 'data/rum.data'; + +CREATE INDEX failed_rumidx ON test_rum USING rum (a rum_tsvector_addon_ops); + +CREATE TABLE tsts (id int, t tsvector, d timestamp); + +\copy tsts from 'data/tsts.data' + +CREATE INDEX tsts_idx ON tsts USING rum (t rum_tsvector_addon_ops, d) + WITH (attach = 'd', to = 't'); + + +INSERT INTO tsts VALUES (-1, 't1 t2', '2016-05-02 02:24:22.326724'); +INSERT INTO tsts VALUES (-2, 't1 t2 t3', '2016-05-02 02:26:22.326724'); + +INSERT INTO test_rum (t) VALUES ('foo bar foo the over foo qq bar'); +INSERT INTO test_rum (t) VALUES ('345 qwerty copyright'); +INSERT INTO test_rum (t) VALUES ('345 qwerty'); +INSERT INTO test_rum (t) VALUES ('A fat cat has just eaten a rat.'); + + +SET enable_seqscan=off; +SET enable_indexscan=off; From 74e9928b6efa2d07986229ea3bd540dd56eee915 Mon Sep 17 00:00:00 2001 From: "Anton A. Melnikov" Date: Wed, 12 Feb 2025 02:55:01 +0300 Subject: [PATCH 2/4] PGPRO-12044; Fix tests int8, altorder and altorder_hash for 32-bit platforms. Caused by: - c01743aa4866e13da2c54e44010abc6d5f986363 (PostgreSQL) Show number of disabled nodes in EXPLAIN ANALYZE output. Tags: rum --- expected/altorder_1.out | 44 ++++++++++++++++++++------- expected/altorder_hash_1.out | 40 +++++++++++++++++++------ expected/int8_1.out | 58 ++++++++++++++++++++++++++++-------- 3 files changed, 110 insertions(+), 32 deletions(-) diff --git a/expected/altorder_1.out b/expected/altorder_1.out index 980515f58e..2ebea27b47 100644 --- a/expected/altorder_1.out +++ b/expected/altorder_1.out @@ -185,9 +185,11 @@ SELECT count(*) FROM atsts WHERE t @@ 'wr|qh'; QUERY PLAN --------------------------------------------------- Aggregate + Disabled Nodes: 1 -> Seq Scan on atsts + Disabled Nodes: 1 Filter: (t @@ '''wr'' | ''qh'''::tsquery) -(3 rows) +(5 rows) SELECT count(*) FROM atsts WHERE t @@ 'wr|qh'; count @@ -230,9 +232,11 @@ SELECT count(*) FROM atsts WHERE d < '2016-05-16 14:21:25'; QUERY PLAN ------------------------------------------------------------------------------- Aggregate + Disabled Nodes: 1 -> Seq Scan on atsts + Disabled Nodes: 1 Filter: (d < 'Mon May 16 14:21:25 2016'::timestamp without time zone) -(3 rows) +(5 rows) SELECT count(*) FROM atsts WHERE d < '2016-05-16 14:21:25'; count @@ -245,9 +249,11 @@ SELECT count(*) FROM atsts WHERE d > '2016-05-16 14:21:25'; QUERY PLAN ------------------------------------------------------------------------------- Aggregate + Disabled Nodes: 1 -> Seq Scan on atsts + Disabled Nodes: 1 Filter: (d > 'Mon May 16 14:21:25 2016'::timestamp without time zone) -(3 rows) +(5 rows) SELECT count(*) FROM atsts WHERE d > '2016-05-16 14:21:25'; count @@ -264,11 +270,14 @@ SELECT id, d, d <=> '2016-05-16 14:21:25' FROM atsts WHERE t @@ 'wr&qh' ORDER BY QUERY PLAN ------------------------------------------------------------------------------------- Limit + Disabled Nodes: 1 -> Sort + Disabled Nodes: 1 Sort Key: ((d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)) -> Seq Scan on atsts + Disabled Nodes: 1 Filter: (t @@ '''wr'' & ''qh'''::tsquery) -(5 rows) +(8 rows) SELECT id, d, d <=> '2016-05-16 14:21:25' FROM atsts WHERE t @@ 'wr&qh' ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5; id | d | ?column? @@ -285,11 +294,14 @@ SELECT id, d, d <=| '2016-05-16 14:21:25' FROM atsts WHERE t @@ 'wr&qh' ORDER BY QUERY PLAN ------------------------------------------------------------------------------------- Limit + Disabled Nodes: 1 -> Sort + Disabled Nodes: 1 Sort Key: ((d <=| 'Mon May 16 14:21:25 2016'::timestamp without time zone)) -> Seq Scan on atsts + Disabled Nodes: 1 Filter: (t @@ '''wr'' & ''qh'''::tsquery) -(5 rows) +(8 rows) SELECT id, d, d <=| '2016-05-16 14:21:25' FROM atsts WHERE t @@ 'wr&qh' ORDER BY d <=| '2016-05-16 14:21:25' LIMIT 5; id | d | ?column? @@ -306,11 +318,14 @@ SELECT id, d, d |=> '2016-05-16 14:21:25' FROM atsts WHERE t @@ 'wr&qh' ORDER BY QUERY PLAN ------------------------------------------------------------------------------------- Limit + Disabled Nodes: 1 -> Sort + Disabled Nodes: 1 Sort Key: ((d |=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)) -> Seq Scan on atsts + Disabled Nodes: 1 Filter: (t @@ '''wr'' & ''qh'''::tsquery) -(5 rows) +(8 rows) SELECT id, d, d |=> '2016-05-16 14:21:25' FROM atsts WHERE t @@ 'wr&qh' ORDER BY d |=> '2016-05-16 14:21:25' LIMIT 5; id | d | ?column? @@ -327,10 +342,13 @@ SELECT id, d, d <=> '2016-05-16 14:21:25' FROM atsts ORDER BY d <=> '2016-05-16 QUERY PLAN ------------------------------------------------------------------------------------- Limit + Disabled Nodes: 1 -> Sort + Disabled Nodes: 1 Sort Key: ((d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)) -> Seq Scan on atsts -(4 rows) + Disabled Nodes: 1 +(7 rows) SELECT id, d, d <=> '2016-05-16 14:21:25' FROM atsts ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5; id | d | ?column? @@ -347,10 +365,12 @@ SELECT id, d FROM atsts WHERE t @@ 'wr&qh' AND d <= '2016-05-16 14:21:25' ORDER QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ Sort + Disabled Nodes: 1 Sort Key: d -> Seq Scan on atsts + Disabled Nodes: 1 Filter: ((t @@ '''wr'' & ''qh'''::tsquery) AND (d <= 'Mon May 16 14:21:25 2016'::timestamp without time zone)) -(4 rows) +(6 rows) SELECT id, d FROM atsts WHERE t @@ 'wr&qh' AND d <= '2016-05-16 14:21:25' ORDER BY d; id | d @@ -398,10 +418,12 @@ SELECT id, d FROM atsts WHERE t @@ 'wr&qh' AND d >= '2016-05-16 14:21:25' ORDER QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ Sort + Disabled Nodes: 1 Sort Key: d -> Seq Scan on atsts + Disabled Nodes: 1 Filter: ((t @@ '''wr'' & ''qh'''::tsquery) AND (d >= 'Mon May 16 14:21:25 2016'::timestamp without time zone)) -(4 rows) +(6 rows) SELECT id, d FROM atsts WHERE t @@ 'wr&qh' AND d >= '2016-05-16 14:21:25' ORDER BY d; id | d @@ -445,10 +467,12 @@ SELECT id, d FROM atsts WHERE t @@ 'wr&q:*' AND d >= '2016-05-16 14:21:25' ORDE QUERY PLAN ------------------------------------------------------------------------------------------------------------------------- Sort + Disabled Nodes: 1 Sort Key: d -> Seq Scan on atsts + Disabled Nodes: 1 Filter: ((t @@ '''wr'' & ''q'':*'::tsquery) AND (d >= 'Mon May 16 14:21:25 2016'::timestamp without time zone)) -(4 rows) +(6 rows) SELECT id, d FROM atsts WHERE t @@ 'wr&q:*' AND d >= '2016-05-16 14:21:25' ORDER BY d; id | d diff --git a/expected/altorder_hash_1.out b/expected/altorder_hash_1.out index e310fbdb89..818ccbe06d 100644 --- a/expected/altorder_hash_1.out +++ b/expected/altorder_hash_1.out @@ -130,9 +130,11 @@ SELECT count(*) FROM atstsh WHERE t @@ 'wr|qh'; QUERY PLAN --------------------------------------------------- Aggregate + Disabled Nodes: 1 -> Seq Scan on atstsh + Disabled Nodes: 1 Filter: (t @@ '''wr'' | ''qh'''::tsquery) -(3 rows) +(5 rows) SELECT count(*) FROM atstsh WHERE t @@ 'wr|qh'; count @@ -175,9 +177,11 @@ SELECT count(*) FROM atstsh WHERE d < '2016-05-16 14:21:25'; QUERY PLAN ------------------------------------------------------------------------------- Aggregate + Disabled Nodes: 1 -> Seq Scan on atstsh + Disabled Nodes: 1 Filter: (d < 'Mon May 16 14:21:25 2016'::timestamp without time zone) -(3 rows) +(5 rows) SELECT count(*) FROM atstsh WHERE d < '2016-05-16 14:21:25'; count @@ -190,9 +194,11 @@ SELECT count(*) FROM atstsh WHERE d > '2016-05-16 14:21:25'; QUERY PLAN ------------------------------------------------------------------------------- Aggregate + Disabled Nodes: 1 -> Seq Scan on atstsh + Disabled Nodes: 1 Filter: (d > 'Mon May 16 14:21:25 2016'::timestamp without time zone) -(3 rows) +(5 rows) SELECT count(*) FROM atstsh WHERE d > '2016-05-16 14:21:25'; count @@ -209,11 +215,14 @@ SELECT id, d, d <=> '2016-05-16 14:21:25' FROM atstsh WHERE t @@ 'wr&qh' ORDER B QUERY PLAN ------------------------------------------------------------------------------------- Limit + Disabled Nodes: 1 -> Sort + Disabled Nodes: 1 Sort Key: ((d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)) -> Seq Scan on atstsh + Disabled Nodes: 1 Filter: (t @@ '''wr'' & ''qh'''::tsquery) -(5 rows) +(8 rows) SELECT id, d, d <=> '2016-05-16 14:21:25' FROM atstsh WHERE t @@ 'wr&qh' ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5; id | d | ?column? @@ -230,11 +239,14 @@ SELECT id, d, d <=| '2016-05-16 14:21:25' FROM atstsh WHERE t @@ 'wr&qh' ORDER B QUERY PLAN ------------------------------------------------------------------------------------- Limit + Disabled Nodes: 1 -> Sort + Disabled Nodes: 1 Sort Key: ((d <=| 'Mon May 16 14:21:25 2016'::timestamp without time zone)) -> Seq Scan on atstsh + Disabled Nodes: 1 Filter: (t @@ '''wr'' & ''qh'''::tsquery) -(5 rows) +(8 rows) SELECT id, d, d <=| '2016-05-16 14:21:25' FROM atstsh WHERE t @@ 'wr&qh' ORDER BY d <=| '2016-05-16 14:21:25' LIMIT 5; id | d | ?column? @@ -251,11 +263,14 @@ SELECT id, d, d |=> '2016-05-16 14:21:25' FROM atstsh WHERE t @@ 'wr&qh' ORDER B QUERY PLAN ------------------------------------------------------------------------------------- Limit + Disabled Nodes: 1 -> Sort + Disabled Nodes: 1 Sort Key: ((d |=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)) -> Seq Scan on atstsh + Disabled Nodes: 1 Filter: (t @@ '''wr'' & ''qh'''::tsquery) -(5 rows) +(8 rows) SELECT id, d, d |=> '2016-05-16 14:21:25' FROM atstsh WHERE t @@ 'wr&qh' ORDER BY d |=> '2016-05-16 14:21:25' LIMIT 5; id | d | ?column? @@ -272,10 +287,13 @@ SELECT id, d, d <=> '2016-05-16 14:21:25' FROM atstsh ORDER BY d <=> '2016-05-16 QUERY PLAN ------------------------------------------------------------------------------------- Limit + Disabled Nodes: 1 -> Sort + Disabled Nodes: 1 Sort Key: ((d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)) -> Seq Scan on atstsh -(4 rows) + Disabled Nodes: 1 +(7 rows) SELECT id, d, d <=> '2016-05-16 14:21:25' FROM atstsh ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5; id | d | ?column? @@ -292,10 +310,12 @@ SELECT id, d FROM atstsh WHERE t @@ 'wr&qh' AND d <= '2016-05-16 14:21:25' ORDE QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ Sort + Disabled Nodes: 1 Sort Key: d -> Seq Scan on atstsh + Disabled Nodes: 1 Filter: ((t @@ '''wr'' & ''qh'''::tsquery) AND (d <= 'Mon May 16 14:21:25 2016'::timestamp without time zone)) -(4 rows) +(6 rows) SELECT id, d FROM atstsh WHERE t @@ 'wr&qh' AND d <= '2016-05-16 14:21:25' ORDER BY d; id | d @@ -316,10 +336,12 @@ SELECT id, d FROM atstsh WHERE t @@ 'wr&qh' AND d >= '2016-05-16 14:21:25' ORDE QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ Sort + Disabled Nodes: 1 Sort Key: d -> Seq Scan on atstsh + Disabled Nodes: 1 Filter: ((t @@ '''wr'' & ''qh'''::tsquery) AND (d >= 'Mon May 16 14:21:25 2016'::timestamp without time zone)) -(4 rows) +(6 rows) SELECT id, d FROM atstsh WHERE t @@ 'wr&qh' AND d >= '2016-05-16 14:21:25' ORDER BY d; id | d diff --git a/expected/int8_1.out b/expected/int8_1.out index ffced0aaf8..de828353ed 100644 --- a/expected/int8_1.out +++ b/expected/int8_1.out @@ -233,9 +233,11 @@ SELECT count(*) FROM test_int8_a WHERE id < 400::int8; QUERY PLAN -------------------------------------- Aggregate + Disabled Nodes: 1 -> Seq Scan on test_int8_a + Disabled Nodes: 1 Filter: (id < '400'::bigint) -(3 rows) +(5 rows) SELECT count(*) FROM test_int8_a WHERE id < 400::int8; count @@ -248,11 +250,14 @@ SELECT id, id <=> 400 FROM test_int8_a WHERE t @@ 'wr&qh' ORDER BY id <=> 400 LI QUERY PLAN --------------------------------------------------------- Limit + Disabled Nodes: 1 -> Sort + Disabled Nodes: 1 Sort Key: ((id <=> '400'::bigint)) -> Seq Scan on test_int8_a + Disabled Nodes: 1 Filter: (t @@ '''wr'' & ''qh'''::tsquery) -(5 rows) +(8 rows) SELECT id, id <=> 400 FROM test_int8_a WHERE t @@ 'wr&qh' ORDER BY id <=> 400 LIMIT 5; id | ?column? @@ -269,11 +274,14 @@ SELECT id, id <=| 400 FROM test_int8_a WHERE t @@ 'wr&qh' ORDER BY id <=| 400 LI QUERY PLAN --------------------------------------------------------- Limit + Disabled Nodes: 1 -> Sort + Disabled Nodes: 1 Sort Key: ((id <=| '400'::bigint)) -> Seq Scan on test_int8_a + Disabled Nodes: 1 Filter: (t @@ '''wr'' & ''qh'''::tsquery) -(5 rows) +(8 rows) SELECT id, id <=| 400 FROM test_int8_a WHERE t @@ 'wr&qh' ORDER BY id <=| 400 LIMIT 5; id | ?column? @@ -290,11 +298,14 @@ SELECT id, id |=> 400 FROM test_int8_a WHERE t @@ 'wr&qh' ORDER BY id |=> 400 LI QUERY PLAN --------------------------------------------------------- Limit + Disabled Nodes: 1 -> Sort + Disabled Nodes: 1 Sort Key: ((id |=> '400'::bigint)) -> Seq Scan on test_int8_a + Disabled Nodes: 1 Filter: (t @@ '''wr'' & ''qh'''::tsquery) -(5 rows) +(8 rows) SELECT id, id |=> 400 FROM test_int8_a WHERE t @@ 'wr&qh' ORDER BY id |=> 400 LIMIT 5; id | ?column? @@ -311,10 +322,12 @@ SELECT id FROM test_int8_a WHERE t @@ 'wr&qh' AND id <= 400::int8 ORDER BY id; QUERY PLAN ------------------------------------------------------------------------------- Sort + Disabled Nodes: 1 Sort Key: id -> Seq Scan on test_int8_a + Disabled Nodes: 1 Filter: ((t @@ '''wr'' & ''qh'''::tsquery) AND (id <= '400'::bigint)) -(4 rows) +(6 rows) SELECT id FROM test_int8_a WHERE t @@ 'wr&qh' AND id <= 400::int8 ORDER BY id; id @@ -336,10 +349,12 @@ SELECT id FROM test_int8_a WHERE t @@ 'wr&qh' AND id >= 400::int8 ORDER BY id; QUERY PLAN ------------------------------------------------------------------------------- Sort + Disabled Nodes: 1 Sort Key: id -> Seq Scan on test_int8_a + Disabled Nodes: 1 Filter: ((t @@ '''wr'' & ''qh'''::tsquery) AND (id >= '400'::bigint)) -(4 rows) +(6 rows) SELECT id FROM test_int8_a WHERE t @@ 'wr&qh' AND id >= 400::int8 ORDER BY id; id @@ -514,9 +529,11 @@ SELECT count(*) FROM test_int8_h_a WHERE id < 400::int8; QUERY PLAN -------------------------------------- Aggregate + Disabled Nodes: 1 -> Seq Scan on test_int8_h_a + Disabled Nodes: 1 Filter: (id < '400'::bigint) -(3 rows) +(5 rows) SELECT count(*) FROM test_int8_h_a WHERE id < 400::int8; count @@ -529,11 +546,14 @@ SELECT id, id <=> 400 FROM test_int8_h_a WHERE t @@ 'wr&qh' ORDER BY id <=> 400 QUERY PLAN --------------------------------------------------------- Limit + Disabled Nodes: 1 -> Sort + Disabled Nodes: 1 Sort Key: ((id <=> '400'::bigint)) -> Seq Scan on test_int8_h_a + Disabled Nodes: 1 Filter: (t @@ '''wr'' & ''qh'''::tsquery) -(5 rows) +(8 rows) SELECT id, id <=> 400 FROM test_int8_h_a WHERE t @@ 'wr&qh' ORDER BY id <=> 400 LIMIT 5; id | ?column? @@ -550,11 +570,14 @@ SELECT id, id <=| 400 FROM test_int8_h_a WHERE t @@ 'wr&qh' ORDER BY id <=| 400 QUERY PLAN --------------------------------------------------------- Limit + Disabled Nodes: 1 -> Sort + Disabled Nodes: 1 Sort Key: ((id <=| '400'::bigint)) -> Seq Scan on test_int8_h_a + Disabled Nodes: 1 Filter: (t @@ '''wr'' & ''qh'''::tsquery) -(5 rows) +(8 rows) SELECT id, id <=| 400 FROM test_int8_h_a WHERE t @@ 'wr&qh' ORDER BY id <=| 400 LIMIT 5; id | ?column? @@ -571,11 +594,14 @@ SELECT id, id |=> 400 FROM test_int8_h_a WHERE t @@ 'wr&qh' ORDER BY id |=> 400 QUERY PLAN --------------------------------------------------------- Limit + Disabled Nodes: 1 -> Sort + Disabled Nodes: 1 Sort Key: ((id |=> '400'::bigint)) -> Seq Scan on test_int8_h_a + Disabled Nodes: 1 Filter: (t @@ '''wr'' & ''qh'''::tsquery) -(5 rows) +(8 rows) SELECT id, id |=> 400 FROM test_int8_h_a WHERE t @@ 'wr&qh' ORDER BY id |=> 400 LIMIT 5; id | ?column? @@ -592,10 +618,12 @@ SELECT id FROM test_int8_h_a WHERE t @@ 'wr&qh' AND id <= 400::int8 ORDER BY id QUERY PLAN ------------------------------------------------------------------------------- Sort + Disabled Nodes: 1 Sort Key: id -> Seq Scan on test_int8_h_a + Disabled Nodes: 1 Filter: ((t @@ '''wr'' & ''qh'''::tsquery) AND (id <= '400'::bigint)) -(4 rows) +(6 rows) SELECT id FROM test_int8_h_a WHERE t @@ 'wr&qh' AND id <= 400::int8 ORDER BY id; id @@ -617,10 +645,12 @@ SELECT id FROM test_int8_h_a WHERE t @@ 'wr&qh' AND id >= 400::int8 ORDER BY id QUERY PLAN ------------------------------------------------------------------------------- Sort + Disabled Nodes: 1 Sort Key: id -> Seq Scan on test_int8_h_a + Disabled Nodes: 1 Filter: ((t @@ '''wr'' & ''qh'''::tsquery) AND (id >= '400'::bigint)) -(4 rows) +(6 rows) SELECT id FROM test_int8_h_a WHERE t @@ 'wr&qh' AND id >= 400::int8 ORDER BY id; id @@ -642,10 +672,12 @@ SELECT id FROM test_int8_h_a WHERE t @@ 'wr&qh' AND id <= 400::int8 ORDER BY id QUERY PLAN ------------------------------------------------------------------------------- Sort + Disabled Nodes: 1 Sort Key: ((id <=> '400'::bigint)) -> Seq Scan on test_int8_h_a + Disabled Nodes: 1 Filter: ((t @@ '''wr'' & ''qh'''::tsquery) AND (id <= '400'::bigint)) -(4 rows) +(6 rows) SELECT id FROM test_int8_h_a WHERE t @@ 'wr&qh' AND id <= 400::int8 ORDER BY id <=> 400::int8; id From 4d5a0ed489ac0190d03fceadb31fd58d6fdacb08 Mon Sep 17 00:00:00 2001 From: "Anton A. Melnikov" Date: Thu, 20 Feb 2025 06:03:28 +0300 Subject: [PATCH 3/4] PGPRO-12044: Add output variant for PG18 for contrib/rum/sql/security.sql test. Caused by: - 774171c4f640853b1cf8747a4762631d2f5d25be (PostgreSQL) Improve reporting of errors in extension script files. Tags: rum --- expected/security_1.out | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 expected/security_1.out diff --git a/expected/security_1.out b/expected/security_1.out new file mode 100644 index 0000000000..e5e76e58e8 --- /dev/null +++ b/expected/security_1.out @@ -0,0 +1,10 @@ +-- Check security CVE-2020-14350 +CREATE FUNCTION rum_anyarray_similar(anyarray,anyarray) RETURNS bool AS $$ SELECT false $$ LANGUAGE SQL; +CREATE EXTENSION rum; +ERROR: function "rum_anyarray_similar" already exists with same argument types +CONTEXT: SQL statement "CREATE FUNCTION rum_anyarray_similar(anyarray,anyarray) +RETURNS bool +AS '$libdir/rum' +LANGUAGE C STRICT STABLE" +extension script file "rum--1.3.sql", near line 1530 +DROP FUNCTION rum_anyarray_similar(anyarray,anyarray); From 9bf66afcb732d9f3264be7a76ac44e78037902b8 Mon Sep 17 00:00:00 2001 From: "Anton A. Melnikov" Date: Mon, 24 Feb 2025 17:06:52 +0300 Subject: [PATCH 4/4] PGPRO-12044: Fix output variants for 32-bit tests . Caused by: - 161320b4b960ee4fe918959be6529ae9b106ea5a (PostgreSQL) Adjust EXPLAIN's output for disabled nodes Tags: rum --- expected/altorder_1.out | 54 ++++++++++----------------- expected/altorder_hash_1.out | 49 +++++++++---------------- expected/int8_1.out | 71 +++++++++++++----------------------- 3 files changed, 64 insertions(+), 110 deletions(-) diff --git a/expected/altorder_1.out b/expected/altorder_1.out index 2ebea27b47..eba8690c2a 100644 --- a/expected/altorder_1.out +++ b/expected/altorder_1.out @@ -185,11 +185,10 @@ SELECT count(*) FROM atsts WHERE t @@ 'wr|qh'; QUERY PLAN --------------------------------------------------- Aggregate - Disabled Nodes: 1 -> Seq Scan on atsts - Disabled Nodes: 1 + Disabled: true Filter: (t @@ '''wr'' | ''qh'''::tsquery) -(5 rows) +(4 rows) SELECT count(*) FROM atsts WHERE t @@ 'wr|qh'; count @@ -232,11 +231,10 @@ SELECT count(*) FROM atsts WHERE d < '2016-05-16 14:21:25'; QUERY PLAN ------------------------------------------------------------------------------- Aggregate - Disabled Nodes: 1 -> Seq Scan on atsts - Disabled Nodes: 1 + Disabled: true Filter: (d < 'Mon May 16 14:21:25 2016'::timestamp without time zone) -(5 rows) +(4 rows) SELECT count(*) FROM atsts WHERE d < '2016-05-16 14:21:25'; count @@ -249,11 +247,10 @@ SELECT count(*) FROM atsts WHERE d > '2016-05-16 14:21:25'; QUERY PLAN ------------------------------------------------------------------------------- Aggregate - Disabled Nodes: 1 -> Seq Scan on atsts - Disabled Nodes: 1 + Disabled: true Filter: (d > 'Mon May 16 14:21:25 2016'::timestamp without time zone) -(5 rows) +(4 rows) SELECT count(*) FROM atsts WHERE d > '2016-05-16 14:21:25'; count @@ -270,14 +267,12 @@ SELECT id, d, d <=> '2016-05-16 14:21:25' FROM atsts WHERE t @@ 'wr&qh' ORDER BY QUERY PLAN ------------------------------------------------------------------------------------- Limit - Disabled Nodes: 1 -> Sort - Disabled Nodes: 1 Sort Key: ((d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)) -> Seq Scan on atsts - Disabled Nodes: 1 + Disabled: true Filter: (t @@ '''wr'' & ''qh'''::tsquery) -(8 rows) +(6 rows) SELECT id, d, d <=> '2016-05-16 14:21:25' FROM atsts WHERE t @@ 'wr&qh' ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5; id | d | ?column? @@ -294,14 +289,12 @@ SELECT id, d, d <=| '2016-05-16 14:21:25' FROM atsts WHERE t @@ 'wr&qh' ORDER BY QUERY PLAN ------------------------------------------------------------------------------------- Limit - Disabled Nodes: 1 -> Sort - Disabled Nodes: 1 Sort Key: ((d <=| 'Mon May 16 14:21:25 2016'::timestamp without time zone)) -> Seq Scan on atsts - Disabled Nodes: 1 + Disabled: true Filter: (t @@ '''wr'' & ''qh'''::tsquery) -(8 rows) +(6 rows) SELECT id, d, d <=| '2016-05-16 14:21:25' FROM atsts WHERE t @@ 'wr&qh' ORDER BY d <=| '2016-05-16 14:21:25' LIMIT 5; id | d | ?column? @@ -318,14 +311,12 @@ SELECT id, d, d |=> '2016-05-16 14:21:25' FROM atsts WHERE t @@ 'wr&qh' ORDER BY QUERY PLAN ------------------------------------------------------------------------------------- Limit - Disabled Nodes: 1 -> Sort - Disabled Nodes: 1 Sort Key: ((d |=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)) -> Seq Scan on atsts - Disabled Nodes: 1 + Disabled: true Filter: (t @@ '''wr'' & ''qh'''::tsquery) -(8 rows) +(6 rows) SELECT id, d, d |=> '2016-05-16 14:21:25' FROM atsts WHERE t @@ 'wr&qh' ORDER BY d |=> '2016-05-16 14:21:25' LIMIT 5; id | d | ?column? @@ -342,13 +333,11 @@ SELECT id, d, d <=> '2016-05-16 14:21:25' FROM atsts ORDER BY d <=> '2016-05-16 QUERY PLAN ------------------------------------------------------------------------------------- Limit - Disabled Nodes: 1 -> Sort - Disabled Nodes: 1 Sort Key: ((d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)) -> Seq Scan on atsts - Disabled Nodes: 1 -(7 rows) + Disabled: true +(5 rows) SELECT id, d, d <=> '2016-05-16 14:21:25' FROM atsts ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5; id | d | ?column? @@ -365,12 +354,11 @@ SELECT id, d FROM atsts WHERE t @@ 'wr&qh' AND d <= '2016-05-16 14:21:25' ORDER QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ Sort - Disabled Nodes: 1 Sort Key: d -> Seq Scan on atsts - Disabled Nodes: 1 + Disabled: true Filter: ((t @@ '''wr'' & ''qh'''::tsquery) AND (d <= 'Mon May 16 14:21:25 2016'::timestamp without time zone)) -(6 rows) +(5 rows) SELECT id, d FROM atsts WHERE t @@ 'wr&qh' AND d <= '2016-05-16 14:21:25' ORDER BY d; id | d @@ -418,12 +406,11 @@ SELECT id, d FROM atsts WHERE t @@ 'wr&qh' AND d >= '2016-05-16 14:21:25' ORDER QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ Sort - Disabled Nodes: 1 Sort Key: d -> Seq Scan on atsts - Disabled Nodes: 1 + Disabled: true Filter: ((t @@ '''wr'' & ''qh'''::tsquery) AND (d >= 'Mon May 16 14:21:25 2016'::timestamp without time zone)) -(6 rows) +(5 rows) SELECT id, d FROM atsts WHERE t @@ 'wr&qh' AND d >= '2016-05-16 14:21:25' ORDER BY d; id | d @@ -467,12 +454,11 @@ SELECT id, d FROM atsts WHERE t @@ 'wr&q:*' AND d >= '2016-05-16 14:21:25' ORDE QUERY PLAN ------------------------------------------------------------------------------------------------------------------------- Sort - Disabled Nodes: 1 Sort Key: d -> Seq Scan on atsts - Disabled Nodes: 1 + Disabled: true Filter: ((t @@ '''wr'' & ''q'':*'::tsquery) AND (d >= 'Mon May 16 14:21:25 2016'::timestamp without time zone)) -(6 rows) +(5 rows) SELECT id, d FROM atsts WHERE t @@ 'wr&q:*' AND d >= '2016-05-16 14:21:25' ORDER BY d; id | d diff --git a/expected/altorder_hash_1.out b/expected/altorder_hash_1.out index 818ccbe06d..95f529d37d 100644 --- a/expected/altorder_hash_1.out +++ b/expected/altorder_hash_1.out @@ -130,11 +130,10 @@ SELECT count(*) FROM atstsh WHERE t @@ 'wr|qh'; QUERY PLAN --------------------------------------------------- Aggregate - Disabled Nodes: 1 -> Seq Scan on atstsh - Disabled Nodes: 1 + Disabled: true Filter: (t @@ '''wr'' | ''qh'''::tsquery) -(5 rows) +(4 rows) SELECT count(*) FROM atstsh WHERE t @@ 'wr|qh'; count @@ -177,11 +176,10 @@ SELECT count(*) FROM atstsh WHERE d < '2016-05-16 14:21:25'; QUERY PLAN ------------------------------------------------------------------------------- Aggregate - Disabled Nodes: 1 -> Seq Scan on atstsh - Disabled Nodes: 1 + Disabled: true Filter: (d < 'Mon May 16 14:21:25 2016'::timestamp without time zone) -(5 rows) +(4 rows) SELECT count(*) FROM atstsh WHERE d < '2016-05-16 14:21:25'; count @@ -194,11 +192,10 @@ SELECT count(*) FROM atstsh WHERE d > '2016-05-16 14:21:25'; QUERY PLAN ------------------------------------------------------------------------------- Aggregate - Disabled Nodes: 1 -> Seq Scan on atstsh - Disabled Nodes: 1 + Disabled: true Filter: (d > 'Mon May 16 14:21:25 2016'::timestamp without time zone) -(5 rows) +(4 rows) SELECT count(*) FROM atstsh WHERE d > '2016-05-16 14:21:25'; count @@ -215,14 +212,12 @@ SELECT id, d, d <=> '2016-05-16 14:21:25' FROM atstsh WHERE t @@ 'wr&qh' ORDER B QUERY PLAN ------------------------------------------------------------------------------------- Limit - Disabled Nodes: 1 -> Sort - Disabled Nodes: 1 Sort Key: ((d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)) -> Seq Scan on atstsh - Disabled Nodes: 1 + Disabled: true Filter: (t @@ '''wr'' & ''qh'''::tsquery) -(8 rows) +(6 rows) SELECT id, d, d <=> '2016-05-16 14:21:25' FROM atstsh WHERE t @@ 'wr&qh' ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5; id | d | ?column? @@ -239,14 +234,12 @@ SELECT id, d, d <=| '2016-05-16 14:21:25' FROM atstsh WHERE t @@ 'wr&qh' ORDER B QUERY PLAN ------------------------------------------------------------------------------------- Limit - Disabled Nodes: 1 -> Sort - Disabled Nodes: 1 Sort Key: ((d <=| 'Mon May 16 14:21:25 2016'::timestamp without time zone)) -> Seq Scan on atstsh - Disabled Nodes: 1 + Disabled: true Filter: (t @@ '''wr'' & ''qh'''::tsquery) -(8 rows) +(6 rows) SELECT id, d, d <=| '2016-05-16 14:21:25' FROM atstsh WHERE t @@ 'wr&qh' ORDER BY d <=| '2016-05-16 14:21:25' LIMIT 5; id | d | ?column? @@ -263,14 +256,12 @@ SELECT id, d, d |=> '2016-05-16 14:21:25' FROM atstsh WHERE t @@ 'wr&qh' ORDER B QUERY PLAN ------------------------------------------------------------------------------------- Limit - Disabled Nodes: 1 -> Sort - Disabled Nodes: 1 Sort Key: ((d |=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)) -> Seq Scan on atstsh - Disabled Nodes: 1 + Disabled: true Filter: (t @@ '''wr'' & ''qh'''::tsquery) -(8 rows) +(6 rows) SELECT id, d, d |=> '2016-05-16 14:21:25' FROM atstsh WHERE t @@ 'wr&qh' ORDER BY d |=> '2016-05-16 14:21:25' LIMIT 5; id | d | ?column? @@ -287,13 +278,11 @@ SELECT id, d, d <=> '2016-05-16 14:21:25' FROM atstsh ORDER BY d <=> '2016-05-16 QUERY PLAN ------------------------------------------------------------------------------------- Limit - Disabled Nodes: 1 -> Sort - Disabled Nodes: 1 Sort Key: ((d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)) -> Seq Scan on atstsh - Disabled Nodes: 1 -(7 rows) + Disabled: true +(5 rows) SELECT id, d, d <=> '2016-05-16 14:21:25' FROM atstsh ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5; id | d | ?column? @@ -310,12 +299,11 @@ SELECT id, d FROM atstsh WHERE t @@ 'wr&qh' AND d <= '2016-05-16 14:21:25' ORDE QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ Sort - Disabled Nodes: 1 Sort Key: d -> Seq Scan on atstsh - Disabled Nodes: 1 + Disabled: true Filter: ((t @@ '''wr'' & ''qh'''::tsquery) AND (d <= 'Mon May 16 14:21:25 2016'::timestamp without time zone)) -(6 rows) +(5 rows) SELECT id, d FROM atstsh WHERE t @@ 'wr&qh' AND d <= '2016-05-16 14:21:25' ORDER BY d; id | d @@ -336,12 +324,11 @@ SELECT id, d FROM atstsh WHERE t @@ 'wr&qh' AND d >= '2016-05-16 14:21:25' ORDE QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ Sort - Disabled Nodes: 1 Sort Key: d -> Seq Scan on atstsh - Disabled Nodes: 1 + Disabled: true Filter: ((t @@ '''wr'' & ''qh'''::tsquery) AND (d >= 'Mon May 16 14:21:25 2016'::timestamp without time zone)) -(6 rows) +(5 rows) SELECT id, d FROM atstsh WHERE t @@ 'wr&qh' AND d >= '2016-05-16 14:21:25' ORDER BY d; id | d diff --git a/expected/int8_1.out b/expected/int8_1.out index de828353ed..0bba72ee56 100644 --- a/expected/int8_1.out +++ b/expected/int8_1.out @@ -233,11 +233,10 @@ SELECT count(*) FROM test_int8_a WHERE id < 400::int8; QUERY PLAN -------------------------------------- Aggregate - Disabled Nodes: 1 -> Seq Scan on test_int8_a - Disabled Nodes: 1 + Disabled: true Filter: (id < '400'::bigint) -(5 rows) +(4 rows) SELECT count(*) FROM test_int8_a WHERE id < 400::int8; count @@ -250,14 +249,12 @@ SELECT id, id <=> 400 FROM test_int8_a WHERE t @@ 'wr&qh' ORDER BY id <=> 400 LI QUERY PLAN --------------------------------------------------------- Limit - Disabled Nodes: 1 -> Sort - Disabled Nodes: 1 Sort Key: ((id <=> '400'::bigint)) -> Seq Scan on test_int8_a - Disabled Nodes: 1 + Disabled: true Filter: (t @@ '''wr'' & ''qh'''::tsquery) -(8 rows) +(6 rows) SELECT id, id <=> 400 FROM test_int8_a WHERE t @@ 'wr&qh' ORDER BY id <=> 400 LIMIT 5; id | ?column? @@ -274,14 +271,12 @@ SELECT id, id <=| 400 FROM test_int8_a WHERE t @@ 'wr&qh' ORDER BY id <=| 400 LI QUERY PLAN --------------------------------------------------------- Limit - Disabled Nodes: 1 -> Sort - Disabled Nodes: 1 Sort Key: ((id <=| '400'::bigint)) -> Seq Scan on test_int8_a - Disabled Nodes: 1 + Disabled: true Filter: (t @@ '''wr'' & ''qh'''::tsquery) -(8 rows) +(6 rows) SELECT id, id <=| 400 FROM test_int8_a WHERE t @@ 'wr&qh' ORDER BY id <=| 400 LIMIT 5; id | ?column? @@ -298,14 +293,12 @@ SELECT id, id |=> 400 FROM test_int8_a WHERE t @@ 'wr&qh' ORDER BY id |=> 400 LI QUERY PLAN --------------------------------------------------------- Limit - Disabled Nodes: 1 -> Sort - Disabled Nodes: 1 Sort Key: ((id |=> '400'::bigint)) -> Seq Scan on test_int8_a - Disabled Nodes: 1 + Disabled: true Filter: (t @@ '''wr'' & ''qh'''::tsquery) -(8 rows) +(6 rows) SELECT id, id |=> 400 FROM test_int8_a WHERE t @@ 'wr&qh' ORDER BY id |=> 400 LIMIT 5; id | ?column? @@ -322,12 +315,11 @@ SELECT id FROM test_int8_a WHERE t @@ 'wr&qh' AND id <= 400::int8 ORDER BY id; QUERY PLAN ------------------------------------------------------------------------------- Sort - Disabled Nodes: 1 Sort Key: id -> Seq Scan on test_int8_a - Disabled Nodes: 1 + Disabled: true Filter: ((t @@ '''wr'' & ''qh'''::tsquery) AND (id <= '400'::bigint)) -(6 rows) +(5 rows) SELECT id FROM test_int8_a WHERE t @@ 'wr&qh' AND id <= 400::int8 ORDER BY id; id @@ -349,12 +341,11 @@ SELECT id FROM test_int8_a WHERE t @@ 'wr&qh' AND id >= 400::int8 ORDER BY id; QUERY PLAN ------------------------------------------------------------------------------- Sort - Disabled Nodes: 1 Sort Key: id -> Seq Scan on test_int8_a - Disabled Nodes: 1 + Disabled: true Filter: ((t @@ '''wr'' & ''qh'''::tsquery) AND (id >= '400'::bigint)) -(6 rows) +(5 rows) SELECT id FROM test_int8_a WHERE t @@ 'wr&qh' AND id >= 400::int8 ORDER BY id; id @@ -529,11 +520,10 @@ SELECT count(*) FROM test_int8_h_a WHERE id < 400::int8; QUERY PLAN -------------------------------------- Aggregate - Disabled Nodes: 1 -> Seq Scan on test_int8_h_a - Disabled Nodes: 1 + Disabled: true Filter: (id < '400'::bigint) -(5 rows) +(4 rows) SELECT count(*) FROM test_int8_h_a WHERE id < 400::int8; count @@ -546,14 +536,12 @@ SELECT id, id <=> 400 FROM test_int8_h_a WHERE t @@ 'wr&qh' ORDER BY id <=> 400 QUERY PLAN --------------------------------------------------------- Limit - Disabled Nodes: 1 -> Sort - Disabled Nodes: 1 Sort Key: ((id <=> '400'::bigint)) -> Seq Scan on test_int8_h_a - Disabled Nodes: 1 + Disabled: true Filter: (t @@ '''wr'' & ''qh'''::tsquery) -(8 rows) +(6 rows) SELECT id, id <=> 400 FROM test_int8_h_a WHERE t @@ 'wr&qh' ORDER BY id <=> 400 LIMIT 5; id | ?column? @@ -570,14 +558,12 @@ SELECT id, id <=| 400 FROM test_int8_h_a WHERE t @@ 'wr&qh' ORDER BY id <=| 400 QUERY PLAN --------------------------------------------------------- Limit - Disabled Nodes: 1 -> Sort - Disabled Nodes: 1 Sort Key: ((id <=| '400'::bigint)) -> Seq Scan on test_int8_h_a - Disabled Nodes: 1 + Disabled: true Filter: (t @@ '''wr'' & ''qh'''::tsquery) -(8 rows) +(6 rows) SELECT id, id <=| 400 FROM test_int8_h_a WHERE t @@ 'wr&qh' ORDER BY id <=| 400 LIMIT 5; id | ?column? @@ -594,14 +580,12 @@ SELECT id, id |=> 400 FROM test_int8_h_a WHERE t @@ 'wr&qh' ORDER BY id |=> 400 QUERY PLAN --------------------------------------------------------- Limit - Disabled Nodes: 1 -> Sort - Disabled Nodes: 1 Sort Key: ((id |=> '400'::bigint)) -> Seq Scan on test_int8_h_a - Disabled Nodes: 1 + Disabled: true Filter: (t @@ '''wr'' & ''qh'''::tsquery) -(8 rows) +(6 rows) SELECT id, id |=> 400 FROM test_int8_h_a WHERE t @@ 'wr&qh' ORDER BY id |=> 400 LIMIT 5; id | ?column? @@ -618,12 +602,11 @@ SELECT id FROM test_int8_h_a WHERE t @@ 'wr&qh' AND id <= 400::int8 ORDER BY id QUERY PLAN ------------------------------------------------------------------------------- Sort - Disabled Nodes: 1 Sort Key: id -> Seq Scan on test_int8_h_a - Disabled Nodes: 1 + Disabled: true Filter: ((t @@ '''wr'' & ''qh'''::tsquery) AND (id <= '400'::bigint)) -(6 rows) +(5 rows) SELECT id FROM test_int8_h_a WHERE t @@ 'wr&qh' AND id <= 400::int8 ORDER BY id; id @@ -645,12 +628,11 @@ SELECT id FROM test_int8_h_a WHERE t @@ 'wr&qh' AND id >= 400::int8 ORDER BY id QUERY PLAN ------------------------------------------------------------------------------- Sort - Disabled Nodes: 1 Sort Key: id -> Seq Scan on test_int8_h_a - Disabled Nodes: 1 + Disabled: true Filter: ((t @@ '''wr'' & ''qh'''::tsquery) AND (id >= '400'::bigint)) -(6 rows) +(5 rows) SELECT id FROM test_int8_h_a WHERE t @@ 'wr&qh' AND id >= 400::int8 ORDER BY id; id @@ -672,12 +654,11 @@ SELECT id FROM test_int8_h_a WHERE t @@ 'wr&qh' AND id <= 400::int8 ORDER BY id QUERY PLAN ------------------------------------------------------------------------------- Sort - Disabled Nodes: 1 Sort Key: ((id <=> '400'::bigint)) -> Seq Scan on test_int8_h_a - Disabled Nodes: 1 + Disabled: true Filter: ((t @@ '''wr'' & ''qh'''::tsquery) AND (id <= '400'::bigint)) -(6 rows) +(5 rows) SELECT id FROM test_int8_h_a WHERE t @@ 'wr&qh' AND id <= 400::int8 ORDER BY id <=> 400::int8; id