mirror of https://github.com/citusdata/citus.git
71 lines
3.0 KiB
Plaintext
71 lines
3.0 KiB
Plaintext
--
|
|
-- PG16
|
|
--
|
|
SHOW server_version \gset
|
|
SELECT substring(:'server_version', '\d+')::int >= 16 AS server_version_ge_16
|
|
\gset
|
|
\if :server_version_ge_16
|
|
\else
|
|
\q
|
|
\endif
|
|
CREATE SCHEMA pg16;
|
|
SET search_path TO pg16;
|
|
SET citus.next_shard_id TO 950000;
|
|
SET citus.shard_count TO 1;
|
|
SET citus.shard_replication_factor TO 1;
|
|
-- test the new vacuum and analyze options
|
|
-- Relevant PG commits:
|
|
-- https://github.com/postgres/postgres/commit/1cbbee03385763b066ae3961fc61f2cd01a0d0d7
|
|
-- https://github.com/postgres/postgres/commit/4211fbd8413b26e0abedbe4338aa7cda2cd469b4
|
|
-- https://github.com/postgres/postgres/commit/a46a7011b27188af526047a111969f257aaf4db8
|
|
CREATE TABLE t1 (a int);
|
|
SELECT create_distributed_table('t1','a');
|
|
create_distributed_table
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
SET citus.log_remote_commands TO ON;
|
|
VACUUM (PROCESS_MAIN FALSE) t1;
|
|
NOTICE: issuing VACUUM (PROCESS_MAIN FALSE) pg16.t1_950000
|
|
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
|
|
VACUUM (PROCESS_MAIN FALSE, PROCESS_TOAST FALSE) t1;
|
|
NOTICE: issuing VACUUM (PROCESS_TOAST FALSE,PROCESS_MAIN FALSE) pg16.t1_950000
|
|
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
|
|
VACUUM (PROCESS_MAIN TRUE) t1;
|
|
NOTICE: issuing VACUUM pg16.t1_950000
|
|
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
|
|
VACUUM (PROCESS_MAIN FALSE, FULL) t1;
|
|
NOTICE: issuing VACUUM (FULL,PROCESS_MAIN FALSE) pg16.t1_950000
|
|
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
|
|
VACUUM (SKIP_DATABASE_STATS) t1;
|
|
NOTICE: issuing VACUUM (SKIP_DATABASE_STATS) pg16.t1_950000
|
|
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
|
|
VACUUM (ONLY_DATABASE_STATS) t1;
|
|
ERROR: ONLY_DATABASE_STATS cannot be specified with a list of tables
|
|
VACUUM (BUFFER_USAGE_LIMIT '512 kB') t1;
|
|
NOTICE: issuing VACUUM (BUFFER_USAGE_LIMIT 512) pg16.t1_950000
|
|
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
|
|
VACUUM (BUFFER_USAGE_LIMIT 0) t1;
|
|
NOTICE: issuing VACUUM (BUFFER_USAGE_LIMIT 0) pg16.t1_950000
|
|
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
|
|
VACUUM (BUFFER_USAGE_LIMIT 16777220) t1;
|
|
ERROR: BUFFER_USAGE_LIMIT option must be 0 or between 128 kB and 16777216 kB
|
|
VACUUM (BUFFER_USAGE_LIMIT -1) t1;
|
|
ERROR: BUFFER_USAGE_LIMIT option must be 0 or between 128 kB and 16777216 kB
|
|
VACUUM (BUFFER_USAGE_LIMIT 'test') t1;
|
|
ERROR: BUFFER_USAGE_LIMIT option must be 0 or between 128 kB and 16777216 kB
|
|
ANALYZE (BUFFER_USAGE_LIMIT '512 kB') t1;
|
|
NOTICE: issuing ANALYZE (BUFFER_USAGE_LIMIT 512) pg16.t1_950000
|
|
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
|
|
ANALYZE (BUFFER_USAGE_LIMIT 0) t1;
|
|
NOTICE: issuing ANALYZE (BUFFER_USAGE_LIMIT 0) pg16.t1_950000
|
|
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
|
|
SET citus.log_remote_commands TO OFF;
|
|
-- only verifying it works and not printing log
|
|
-- remote commands because it can be flaky
|
|
VACUUM (ONLY_DATABASE_STATS);
|
|
\set VERBOSITY terse
|
|
SET client_min_messages TO ERROR;
|
|
DROP SCHEMA pg16 CASCADE;
|