pg13_propagate test update

update

update

update

.

update

update

update

.
pull/7728/head
Mehmet Yilmaz 2024-11-07 13:16:40 +00:00
parent c0a5f5c78c
commit 65a5730611
2 changed files with 43 additions and 27 deletions

View File

@ -24,33 +24,41 @@ SELECT create_distributed_table('t1', 'b');
-- test alter target before distribution -- test alter target before distribution
ALTER STATISTICS s3 SET STATISTICS 46; ALTER STATISTICS s3 SET STATISTICS 46;
\c - - - :worker_1_port \c - - - :worker_1_port
SELECT stxstattarget, stxrelid::regclass -- for stxstattarget, re-interpret -1 as null to avoid adding another test output for pg < 17
-- Changed stxstattarget in pg_statistic_ext to use nullable representation, removing explicit -1 for default statistics target in PostgreSQL 17.
-- https://github.com/postgres/postgres/commit/012460ee93c304fbc7220e5b55d9d0577fc766ab
SELECT
nullif(stxstattarget, -1) AS stxstattarget,
stxrelid::regclass
FROM pg_statistic_ext FROM pg_statistic_ext
WHERE stxnamespace IN ( WHERE stxnamespace IN (
SELECT oid SELECT oid
FROM pg_namespace FROM pg_namespace
WHERE nspname IN ('statistics''TestTarget') WHERE nspname IN ('statistics''TestTarget')
) )
AND stxname SIMILAR TO '%\_\d+' AND stxname SIMILAR TO '%\_\d+'
ORDER BY stxstattarget, stxrelid::regclass ASC; ORDER BY
nullif(stxstattarget, -1) IS NULL DESC, -- Make sure null values are handled consistently
nullif(stxstattarget, -1) NULLS FIRST, -- Use NULLS FIRST to ensure consistent placement of nulls
stxrelid::regclass ASC;
stxstattarget | stxrelid stxstattarget | stxrelid
--------------------------------------------------------------------- ---------------------------------------
-1 | "statistics'TestTarget".t1_980000 | "statistics'TestTarget".t1_980000
-1 | "statistics'TestTarget".t1_980002 | "statistics'TestTarget".t1_980002
-1 | "statistics'TestTarget".t1_980004 | "statistics'TestTarget".t1_980004
-1 | "statistics'TestTarget".t1_980006 | "statistics'TestTarget".t1_980006
-1 | "statistics'TestTarget".t1_980008 | "statistics'TestTarget".t1_980008
-1 | "statistics'TestTarget".t1_980010 | "statistics'TestTarget".t1_980010
-1 | "statistics'TestTarget".t1_980012 | "statistics'TestTarget".t1_980012
-1 | "statistics'TestTarget".t1_980014 | "statistics'TestTarget".t1_980014
-1 | "statistics'TestTarget".t1_980016 | "statistics'TestTarget".t1_980016
-1 | "statistics'TestTarget".t1_980018 | "statistics'TestTarget".t1_980018
-1 | "statistics'TestTarget".t1_980020 | "statistics'TestTarget".t1_980020
-1 | "statistics'TestTarget".t1_980022 | "statistics'TestTarget".t1_980022
-1 | "statistics'TestTarget".t1_980024 | "statistics'TestTarget".t1_980024
-1 | "statistics'TestTarget".t1_980026 | "statistics'TestTarget".t1_980026
-1 | "statistics'TestTarget".t1_980028 | "statistics'TestTarget".t1_980028
-1 | "statistics'TestTarget".t1_980030 | "statistics'TestTarget".t1_980030
3 | "statistics'TestTarget".t1_980000 3 | "statistics'TestTarget".t1_980000
3 | "statistics'TestTarget".t1_980002 3 | "statistics'TestTarget".t1_980002
3 | "statistics'TestTarget".t1_980004 3 | "statistics'TestTarget".t1_980004

View File

@ -23,15 +23,23 @@ SELECT create_distributed_table('t1', 'b');
ALTER STATISTICS s3 SET STATISTICS 46; ALTER STATISTICS s3 SET STATISTICS 46;
\c - - - :worker_1_port \c - - - :worker_1_port
SELECT stxstattarget, stxrelid::regclass -- for stxstattarget, re-interpret -1 as null to avoid adding another test output for pg < 17
-- Changed stxstattarget in pg_statistic_ext to use nullable representation, removing explicit -1 for default statistics target in PostgreSQL 17.
-- https://github.com/postgres/postgres/commit/012460ee93c304fbc7220e5b55d9d0577fc766ab
SELECT
nullif(stxstattarget, -1) AS stxstattarget,
stxrelid::regclass
FROM pg_statistic_ext FROM pg_statistic_ext
WHERE stxnamespace IN ( WHERE stxnamespace IN (
SELECT oid SELECT oid
FROM pg_namespace FROM pg_namespace
WHERE nspname IN ('statistics''TestTarget') WHERE nspname IN ('statistics''TestTarget')
) )
AND stxname SIMILAR TO '%\_\d+' AND stxname SIMILAR TO '%\_\d+'
ORDER BY stxstattarget, stxrelid::regclass ASC; ORDER BY
nullif(stxstattarget, -1) IS NULL DESC, -- Make sure null values are handled consistently
nullif(stxstattarget, -1) NULLS FIRST, -- Use NULLS FIRST to ensure consistent placement of nulls
stxrelid::regclass ASC;
\c - - - :master_port \c - - - :master_port
-- the first one should log a notice that says statistics object does not exist -- the first one should log a notice that says statistics object does not exist