diff -U3 /tmp/cirrus-ci-build/contrib/amcheck/expected/check_btree.out /tmp/cirrus-ci-build/build/testrun/amcheck-running/regress/results/check_btree.out --- /tmp/cirrus-ci-build/contrib/amcheck/expected/check_btree.out 2024-04-02 00:56:34.461246000 +0000 +++ /tmp/cirrus-ci-build/build/testrun/amcheck-running/regress/results/check_btree.out 2024-04-02 00:59:54.115064000 +0000 @@ -128,148 +128,10 @@ -- repeat expansive tests for index built using insertions TRUNCATE bttest_multi; INSERT INTO bttest_multi SELECT i, i%2 FROM generate_series(1, 100000) as i; -SELECT bt_index_parent_check('bttest_multi_idx', true, true); - bt_index_parent_check ------------------------ - -(1 row) - --- --- Test for multilevel page deletion/downlink present checks, and rootdescend --- checks --- -INSERT INTO delete_test_table SELECT i, 1, 2, 3 FROM generate_series(1,80000) i; -ALTER TABLE delete_test_table ADD PRIMARY KEY (a,b,c,d); --- Delete most entries, and vacuum, deleting internal pages and creating "fast --- root" -DELETE FROM delete_test_table WHERE a < 79990; -VACUUM delete_test_table; -SELECT bt_index_parent_check('delete_test_table_pkey', true); - bt_index_parent_check ------------------------ - -(1 row) - --- --- BUG #15597: must not assume consistent input toasting state when forming --- tuple. Bloom filter must fingerprint normalized index tuple representation. --- -CREATE TABLE toast_bug(buggy text); -ALTER TABLE toast_bug ALTER COLUMN buggy SET STORAGE extended; -CREATE INDEX toasty ON toast_bug(buggy); --- pg_attribute entry for toasty.buggy (the index) will have plain storage: -UPDATE pg_attribute SET attstorage = 'p' -WHERE attrelid = 'toasty'::regclass AND attname = 'buggy'; --- Whereas pg_attribute entry for toast_bug.buggy (the table) still has extended storage: -SELECT attstorage FROM pg_attribute -WHERE attrelid = 'toast_bug'::regclass AND attname = 'buggy'; - attstorage ------------- - x -(1 row) - --- Insert compressible heap tuple (comfortably exceeds TOAST_TUPLE_THRESHOLD): -INSERT INTO toast_bug SELECT repeat('a', 2200); --- Should not get false positive report of corruption: -SELECT bt_index_check('toasty', true); - bt_index_check ----------------- - -(1 row) - --- --- Check that index expressions and predicates are run as the table's owner --- -TRUNCATE bttest_a; -INSERT INTO bttest_a SELECT * FROM generate_series(1, 1000); -ALTER TABLE bttest_a OWNER TO regress_bttest_role; --- A dummy index function checking current_user -CREATE FUNCTION ifun(int8) RETURNS int8 AS $$ -BEGIN - ASSERT current_user = 'regress_bttest_role', - format('ifun(%s) called by %s', $1, current_user); - RETURN $1; -END; -$$ LANGUAGE plpgsql IMMUTABLE; -CREATE INDEX bttest_a_expr_idx ON bttest_a ((ifun(id) + ifun(0))) - WHERE ifun(id + 10) > ifun(10); -SELECT bt_index_check('bttest_a_expr_idx', true); - bt_index_check ----------------- - -(1 row) - --- UNIQUE constraint check -SELECT bt_index_check('bttest_a_idx', heapallindexed => true, checkunique => true); - bt_index_check ----------------- - -(1 row) - -SELECT bt_index_check('bttest_b_idx', heapallindexed => false, checkunique => true); - bt_index_check ----------------- - -(1 row) - -SELECT bt_index_parent_check('bttest_a_idx', heapallindexed => true, rootdescend => true, checkunique => true); - bt_index_parent_check ------------------------ - -(1 row) - -SELECT bt_index_parent_check('bttest_b_idx', heapallindexed => true, rootdescend => false, checkunique => true); - bt_index_parent_check ------------------------ - -(1 row) - --- Check that null values in an unique index are not treated as equal -CREATE TABLE bttest_unique_nulls (a serial, b int, c int UNIQUE); -INSERT INTO bttest_unique_nulls VALUES (generate_series(1, 10000), 2, default); -SELECT bt_index_check('bttest_unique_nulls_c_key', heapallindexed => true, checkunique => true); - bt_index_check ----------------- - -(1 row) - -CREATE INDEX on bttest_unique_nulls (b,c); -SELECT bt_index_check('bttest_unique_nulls_b_c_idx', heapallindexed => true, checkunique => true); - bt_index_check ----------------- - -(1 row) - --- Check support of both 1B and 4B header sizes of short varlena datum -CREATE TABLE varlena_bug (v text); -ALTER TABLE varlena_bug ALTER column v SET storage plain; -INSERT INTO varlena_bug VALUES ('x'); -COPY varlena_bug from stdin; -CREATE INDEX varlena_bug_idx on varlena_bug(v); -SELECT bt_index_check('varlena_bug_idx', true); - bt_index_check ----------------- - -(1 row) - --- Also check that we compress varlena values, which were previously stored --- uncompressed in index. -INSERT INTO varlena_bug VALUES (repeat('Test', 250)); -ALTER TABLE varlena_bug ALTER COLUMN v SET STORAGE extended; -SELECT bt_index_check('varlena_bug_idx', true); - bt_index_check ----------------- - -(1 row) - --- cleanup -DROP TABLE bttest_a; -DROP TABLE bttest_b; -DROP TABLE bttest_multi; -DROP TABLE delete_test_table; -DROP TABLE toast_bug; -DROP FUNCTION ifun(int8); -DROP TABLE bttest_unique_nulls; -DROP OWNED BY regress_bttest_role; -- permissions -DROP ROLE regress_bttest_role; -DROP TABLE varlena_bug; +WARNING: terminating connection because of crash of another server process +DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. +HINT: In a moment you should be able to reconnect to the database and repeat your command. +server closed the connection unexpectedly + This probably means the server terminated abnormally + before or while processing the request. +connection to server was lost diff -U3 /tmp/cirrus-ci-build/contrib/amcheck/expected/check_heap.out /tmp/cirrus-ci-build/build/testrun/amcheck-running/regress/results/check_heap.out --- /tmp/cirrus-ci-build/contrib/amcheck/expected/check_heap.out 2024-04-02 00:56:34.461359000 +0000 +++ /tmp/cirrus-ci-build/build/testrun/amcheck-running/regress/results/check_heap.out 2024-04-02 00:59:54.136146000 +0000 @@ -1,240 +1,2 @@ -CREATE TABLE heaptest (a integer, b text); -REVOKE ALL ON heaptest FROM PUBLIC; --- Check that invalid skip option is rejected -SELECT * FROM verify_heapam(relation := 'heaptest', skip := 'rope'); -ERROR: invalid skip option -HINT: Valid skip options are "all-visible", "all-frozen", and "none". --- Check specifying invalid block ranges when verifying an empty table -SELECT * FROM verify_heapam(relation := 'heaptest', startblock := 0, endblock := 0); - blkno | offnum | attnum | msg --------+--------+--------+----- -(0 rows) - -SELECT * FROM verify_heapam(relation := 'heaptest', startblock := 5, endblock := 8); - blkno | offnum | attnum | msg --------+--------+--------+----- -(0 rows) - --- Check that valid options are not rejected nor corruption reported --- for an empty table, and that skip enum-like parameter is case-insensitive -SELECT * FROM verify_heapam(relation := 'heaptest', skip := 'none'); - blkno | offnum | attnum | msg --------+--------+--------+----- -(0 rows) - -SELECT * FROM verify_heapam(relation := 'heaptest', skip := 'all-frozen'); - blkno | offnum | attnum | msg --------+--------+--------+----- -(0 rows) - -SELECT * FROM verify_heapam(relation := 'heaptest', skip := 'all-visible'); - blkno | offnum | attnum | msg --------+--------+--------+----- -(0 rows) - -SELECT * FROM verify_heapam(relation := 'heaptest', skip := 'None'); - blkno | offnum | attnum | msg --------+--------+--------+----- -(0 rows) - -SELECT * FROM verify_heapam(relation := 'heaptest', skip := 'All-Frozen'); - blkno | offnum | attnum | msg --------+--------+--------+----- -(0 rows) - -SELECT * FROM verify_heapam(relation := 'heaptest', skip := 'All-Visible'); - blkno | offnum | attnum | msg --------+--------+--------+----- -(0 rows) - -SELECT * FROM verify_heapam(relation := 'heaptest', skip := 'NONE'); - blkno | offnum | attnum | msg --------+--------+--------+----- -(0 rows) - -SELECT * FROM verify_heapam(relation := 'heaptest', skip := 'ALL-FROZEN'); - blkno | offnum | attnum | msg --------+--------+--------+----- -(0 rows) - -SELECT * FROM verify_heapam(relation := 'heaptest', skip := 'ALL-VISIBLE'); - blkno | offnum | attnum | msg --------+--------+--------+----- -(0 rows) - --- Add some data so subsequent tests are not entirely trivial -INSERT INTO heaptest (a, b) - (SELECT gs, repeat('x', gs) - FROM generate_series(1,50) gs); --- pg_stat_io test: --- verify_heapam always uses a BAS_BULKREAD BufferAccessStrategy, whereas a --- sequential scan does so only if the table is large enough when compared to --- shared buffers (see initscan()). CREATE DATABASE ... also unconditionally --- uses a BAS_BULKREAD strategy, but we have chosen to use a tablespace and --- verify_heapam to provide coverage instead of adding another expensive --- operation to the main regression test suite. --- --- Create an alternative tablespace and move the heaptest table to it, causing --- it to be rewritten and all the blocks to reliably evicted from shared --- buffers -- guaranteeing actual reads when we next select from it in the --- same transaction. The heaptest table is smaller than the default --- wal_skip_threshold, so a wal_level=minimal commit reads the table into --- shared_buffers. A transaction delays that and excludes any autovacuum. -SET allow_in_place_tablespaces = true; -CREATE TABLESPACE regress_test_stats_tblspc LOCATION ''; -SELECT sum(reads) AS stats_bulkreads_before - FROM pg_stat_io WHERE context = 'bulkread' \gset -BEGIN; -ALTER TABLE heaptest SET TABLESPACE regress_test_stats_tblspc; --- Check that valid options are not rejected nor corruption reported --- for a non-empty table -SELECT * FROM verify_heapam(relation := 'heaptest', skip := 'none'); - blkno | offnum | attnum | msg --------+--------+--------+----- -(0 rows) - -SELECT * FROM verify_heapam(relation := 'heaptest', skip := 'all-frozen'); - blkno | offnum | attnum | msg --------+--------+--------+----- -(0 rows) - -SELECT * FROM verify_heapam(relation := 'heaptest', skip := 'all-visible'); - blkno | offnum | attnum | msg --------+--------+--------+----- -(0 rows) - -SELECT * FROM verify_heapam(relation := 'heaptest', startblock := 0, endblock := 0); - blkno | offnum | attnum | msg --------+--------+--------+----- -(0 rows) - -COMMIT; --- verify_heapam should have read in the page written out by --- ALTER TABLE ... SET TABLESPACE ... --- causing an additional bulkread, which should be reflected in pg_stat_io. -SELECT pg_stat_force_next_flush(); - pg_stat_force_next_flush --------------------------- - -(1 row) - -SELECT sum(reads) AS stats_bulkreads_after - FROM pg_stat_io WHERE context = 'bulkread' \gset -SELECT :stats_bulkreads_after > :stats_bulkreads_before; - ?column? ----------- - t -(1 row) - -CREATE ROLE regress_heaptest_role; --- verify permissions are checked (error due to function not callable) -SET ROLE regress_heaptest_role; -SELECT * FROM verify_heapam(relation := 'heaptest'); -ERROR: permission denied for function verify_heapam -RESET ROLE; -GRANT EXECUTE ON FUNCTION verify_heapam(regclass, boolean, boolean, text, bigint, bigint) TO regress_heaptest_role; --- verify permissions are now sufficient -SET ROLE regress_heaptest_role; -SELECT * FROM verify_heapam(relation := 'heaptest'); - blkno | offnum | attnum | msg --------+--------+--------+----- -(0 rows) - -RESET ROLE; --- Check specifying invalid block ranges when verifying a non-empty table. -SELECT * FROM verify_heapam(relation := 'heaptest', startblock := 0, endblock := 10000); -ERROR: ending block number must be between 0 and 0 -SELECT * FROM verify_heapam(relation := 'heaptest', startblock := 10000, endblock := 11000); -ERROR: starting block number must be between 0 and 0 --- Vacuum freeze to change the xids encountered in subsequent tests -VACUUM (FREEZE, DISABLE_PAGE_SKIPPING) heaptest; --- Check that valid options are not rejected nor corruption reported --- for a non-empty frozen table -SELECT * FROM verify_heapam(relation := 'heaptest', skip := 'none'); - blkno | offnum | attnum | msg --------+--------+--------+----- -(0 rows) - -SELECT * FROM verify_heapam(relation := 'heaptest', skip := 'all-frozen'); - blkno | offnum | attnum | msg --------+--------+--------+----- -(0 rows) - -SELECT * FROM verify_heapam(relation := 'heaptest', skip := 'all-visible'); - blkno | offnum | attnum | msg --------+--------+--------+----- -(0 rows) - -SELECT * FROM verify_heapam(relation := 'heaptest', startblock := 0, endblock := 0); - blkno | offnum | attnum | msg --------+--------+--------+----- -(0 rows) - --- Check that partitioned tables (the parent ones) which don't have visibility --- maps are rejected -CREATE TABLE test_partitioned (a int, b text default repeat('x', 5000)) - PARTITION BY list (a); -SELECT * FROM verify_heapam('test_partitioned', - startblock := NULL, - endblock := NULL); -ERROR: cannot check relation "test_partitioned" -DETAIL: This operation is not supported for partitioned tables. --- Check that valid options are not rejected nor corruption reported --- for an empty partition table (the child one) -CREATE TABLE test_partition partition OF test_partitioned FOR VALUES IN (1); -SELECT * FROM verify_heapam('test_partition', - startblock := NULL, - endblock := NULL); - blkno | offnum | attnum | msg --------+--------+--------+----- -(0 rows) - --- Check that valid options are not rejected nor corruption reported --- for a non-empty partition table (the child one) -INSERT INTO test_partitioned (a) (SELECT 1 FROM generate_series(1,1000) gs); -SELECT * FROM verify_heapam('test_partition', - startblock := NULL, - endblock := NULL); - blkno | offnum | attnum | msg --------+--------+--------+----- -(0 rows) - --- Check that indexes are rejected -CREATE INDEX test_index ON test_partition (a); -SELECT * FROM verify_heapam('test_index', - startblock := NULL, - endblock := NULL); -ERROR: cannot check relation "test_index" -DETAIL: This operation is not supported for indexes. --- Check that views are rejected -CREATE VIEW test_view AS SELECT 1; -SELECT * FROM verify_heapam('test_view', - startblock := NULL, - endblock := NULL); -ERROR: cannot check relation "test_view" -DETAIL: This operation is not supported for views. --- Check that sequences are rejected -CREATE SEQUENCE test_sequence; -SELECT * FROM verify_heapam('test_sequence', - startblock := NULL, - endblock := NULL); - blkno | offnum | attnum | msg --------+--------+--------+----- -(0 rows) - --- Check that foreign tables are rejected -CREATE FOREIGN DATA WRAPPER dummy; -CREATE SERVER dummy_server FOREIGN DATA WRAPPER dummy; -CREATE FOREIGN TABLE test_foreign_table () SERVER dummy_server; -SELECT * FROM verify_heapam('test_foreign_table', - startblock := NULL, - endblock := NULL); -ERROR: cannot check relation "test_foreign_table" -DETAIL: This operation is not supported for foreign tables. --- cleanup -DROP TABLE heaptest; -DROP TABLESPACE regress_test_stats_tblspc; -DROP TABLE test_partition; -DROP TABLE test_partitioned; -DROP OWNED BY regress_heaptest_role; -- permissions -DROP ROLE regress_heaptest_role; +psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory + Is the server running locally and accepting connections on that socket?