alter_index test update

update

.

update

.

update

Revert "update"

This reverts commit 630cff9648fb2c453d98dfa7baf7fc90fe1aa8d3.

update

update

.

fix

style update

remove
pull/7749/head
Mehmet Yilmaz 2024-11-07 13:16:50 +00:00
parent c0a5f5c78c
commit 0fa4a59405
2 changed files with 15 additions and 7 deletions

View File

@ -32,29 +32,33 @@ SELECT create_distributed_table('t2','a');
(1 row) (1 row)
-- verify statistics is set -- verify statistics is set
SELECT c.relname, a.attstattarget -- pg17 Changed `attstattarget` in `pg_attribute` to use `NullableDatum`, allowing null representation for default statistics target in PostgreSQL 17.
-- https://github.com/postgres/postgres/commit/6a004f1be87d34cfe51acf2fe2552d2b08a79273
SELECT c.relname,
CASE WHEN a.attstattarget = -1 THEN NULL ELSE a.attstattarget END AS attstattarget
FROM pg_attribute a FROM pg_attribute a
JOIN pg_class c ON a.attrelid = c.oid AND c.relname LIKE 'test\_idx%' JOIN pg_class c ON a.attrelid = c.oid AND c.relname LIKE 'test\_idx%'
ORDER BY c.relname, a.attnum; ORDER BY c.relname, a.attnum;
relname | attstattarget relname | attstattarget
--------------------------------------------------------------------- ---------------------------------------------------------------------
test_idx | 4646 test_idx | 4646
test_idx2 | -1 test_idx2 |
test_idx2 | 10000 test_idx2 | 10000
test_idx2 | 3737 test_idx2 | 3737
(4 rows) (4 rows)
\c - - - :worker_1_port \c - - - :worker_1_port
SELECT c.relname, a.attstattarget SELECT c.relname,
CASE WHEN a.attstattarget = -1 THEN NULL ELSE a.attstattarget END AS attstattarget
FROM pg_attribute a FROM pg_attribute a
JOIN pg_class c ON a.attrelid = c.oid AND c.relname SIMILAR TO 'test\_idx%\_\d%' JOIN pg_class c ON a.attrelid = c.oid AND c.relname SIMILAR TO 'test\_idx%\_\d%'
ORDER BY c.relname, a.attnum; ORDER BY c.relname, a.attnum;
relname | attstattarget relname | attstattarget
--------------------------------------------------------------------- ---------------------------------------------------------------------
test_idx2_980004 | -1 test_idx2_980004 |
test_idx2_980004 | 10000 test_idx2_980004 | 10000
test_idx2_980004 | 3737 test_idx2_980004 | 3737
test_idx2_980006 | -1 test_idx2_980006 |
test_idx2_980006 | 10000 test_idx2_980006 | 10000
test_idx2_980006 | 3737 test_idx2_980006 | 3737
test_idx_980000 | 4646 test_idx_980000 | 4646

View File

@ -23,13 +23,17 @@ ALTER INDEX test_idx2 ALTER COLUMN 2 SET STATISTICS 99999;
SELECT create_distributed_table('t2','a'); SELECT create_distributed_table('t2','a');
-- verify statistics is set -- verify statistics is set
SELECT c.relname, a.attstattarget -- pg17 Changed `attstattarget` in `pg_attribute` to use `NullableDatum`, allowing null representation for default statistics target in PostgreSQL 17.
-- https://github.com/postgres/postgres/commit/6a004f1be87d34cfe51acf2fe2552d2b08a79273
SELECT c.relname,
CASE WHEN a.attstattarget = -1 THEN NULL ELSE a.attstattarget END AS attstattarget
FROM pg_attribute a FROM pg_attribute a
JOIN pg_class c ON a.attrelid = c.oid AND c.relname LIKE 'test\_idx%' JOIN pg_class c ON a.attrelid = c.oid AND c.relname LIKE 'test\_idx%'
ORDER BY c.relname, a.attnum; ORDER BY c.relname, a.attnum;
\c - - - :worker_1_port \c - - - :worker_1_port
SELECT c.relname, a.attstattarget SELECT c.relname,
CASE WHEN a.attstattarget = -1 THEN NULL ELSE a.attstattarget END AS attstattarget
FROM pg_attribute a FROM pg_attribute a
JOIN pg_class c ON a.attrelid = c.oid AND c.relname SIMILAR TO 'test\_idx%\_\d%' JOIN pg_class c ON a.attrelid = c.oid AND c.relname SIMILAR TO 'test\_idx%\_\d%'
ORDER BY c.relname, a.attnum; ORDER BY c.relname, a.attnum;