mirror of https://github.com/citusdata/citus.git
Adds ignore for Postgres 14
parent
e1c06576cc
commit
6897e21245
|
@ -36,12 +36,29 @@ select datistemplate from pg_database where datname = 'regression';
|
||||||
f
|
f
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
set citus.log_remote_commands = true;
|
DO $$
|
||||||
set citus.grep_remote_commands = '%ALTER DATABASE%';
|
DECLARE
|
||||||
alter database regression REFRESH COLLATION VERSION;
|
v_version_num numeric;
|
||||||
|
BEGIN
|
||||||
|
SELECT current_setting('server_version_num')::numeric INTO v_version_num;
|
||||||
|
IF v_version_num >= 150000 THEN
|
||||||
|
set citus.log_remote_commands = true;
|
||||||
|
set citus.grep_remote_commands = '%ALTER DATABASE%';
|
||||||
|
alter database regression REFRESH COLLATION VERSION;
|
||||||
|
set citus.log_remote_commands = false;
|
||||||
|
ELSE
|
||||||
|
RAISE NOTICE 'Skipping alter database .. REFRESH COLLATION VERSION for PostgreSQL 14';
|
||||||
|
END IF;
|
||||||
|
END;
|
||||||
|
$$;
|
||||||
NOTICE: version has not changed
|
NOTICE: version has not changed
|
||||||
|
CONTEXT: SQL statement "alter database regression REFRESH COLLATION VERSION"
|
||||||
|
PL/pgSQL function inline_code_block line XX at SQL statement
|
||||||
NOTICE: issuing ALTER DATABASE regression REFRESH COLLATION VERSION;
|
NOTICE: issuing ALTER DATABASE regression REFRESH COLLATION VERSION;
|
||||||
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
|
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
|
||||||
|
CONTEXT: SQL statement "alter database regression REFRESH COLLATION VERSION"
|
||||||
|
PL/pgSQL function inline_code_block line XX at SQL statement
|
||||||
NOTICE: issuing ALTER DATABASE regression REFRESH COLLATION VERSION;
|
NOTICE: issuing ALTER DATABASE regression REFRESH COLLATION VERSION;
|
||||||
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
|
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
|
||||||
set citus.log_remote_commands = false;
|
CONTEXT: SQL statement "alter database regression REFRESH COLLATION VERSION"
|
||||||
|
PL/pgSQL function inline_code_block line XX at SQL statement
|
|
@ -0,0 +1,54 @@
|
||||||
|
--since ALLOW_CONNECTIONS alter option should be executed in a different database
|
||||||
|
-- and since we don't have a multiple database support for now,
|
||||||
|
-- this statement will get error
|
||||||
|
alter database regression ALLOW_CONNECTIONS false;
|
||||||
|
ERROR: ALLOW_CONNECTIONS is not supported
|
||||||
|
DO $$
|
||||||
|
declare
|
||||||
|
v_connlimit numeric;
|
||||||
|
v_connlimit_fetched int;
|
||||||
|
begin
|
||||||
|
select datconnlimit into v_connlimit from pg_database where datname = 'regression';
|
||||||
|
alter database regression with CONNECTION LIMIT 100;
|
||||||
|
select datconnlimit into v_connlimit_fetched from pg_database where datname = 'regression';
|
||||||
|
raise notice 'v_connlimit: %, v_connlimit_fetched: %', v_connlimit, v_connlimit_fetched;
|
||||||
|
execute 'alter database regression with CONNECTION LIMIT ' || v_connlimit;
|
||||||
|
select datconnlimit into v_connlimit_fetched from pg_database where datname = 'regression';
|
||||||
|
raise notice 'v_connlimit: %, v_connlimit_fetched: %', v_connlimit, v_connlimit_fetched;
|
||||||
|
end;
|
||||||
|
$$
|
||||||
|
language plpgsql;
|
||||||
|
NOTICE: v_connlimit: -1, v_connlimit_fetched: 100
|
||||||
|
CONTEXT: PL/pgSQL function inline_code_block line XX at RAISE
|
||||||
|
NOTICE: v_connlimit: -1, v_connlimit_fetched: -1
|
||||||
|
CONTEXT: PL/pgSQL function inline_code_block line XX at RAISE
|
||||||
|
alter database regression with IS_TEMPLATE true;
|
||||||
|
select datistemplate from pg_database where datname = 'regression';
|
||||||
|
datistemplate
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
alter database regression with IS_TEMPLATE false;
|
||||||
|
select datistemplate from pg_database where datname = 'regression';
|
||||||
|
datistemplate
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
f
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
DO $$
|
||||||
|
DECLARE
|
||||||
|
v_version_num numeric;
|
||||||
|
BEGIN
|
||||||
|
SELECT current_setting('server_version_num')::numeric INTO v_version_num;
|
||||||
|
IF v_version_num >= 150000 THEN
|
||||||
|
set citus.log_remote_commands = true;
|
||||||
|
set citus.grep_remote_commands = '%ALTER DATABASE%';
|
||||||
|
alter database regression REFRESH COLLATION VERSION;
|
||||||
|
set citus.log_remote_commands = false;
|
||||||
|
ELSE
|
||||||
|
RAISE NOTICE 'Skipping alter database .. REFRESH COLLATION VERSION for PostgreSQL 14';
|
||||||
|
END IF;
|
||||||
|
END;
|
||||||
|
$$;
|
||||||
|
Skipping alter database .. REFRESH COLLATION VERSION for PostgreSQL 14
|
|
@ -27,10 +27,24 @@ select datistemplate from pg_database where datname = 'regression';
|
||||||
alter database regression with IS_TEMPLATE false;
|
alter database regression with IS_TEMPLATE false;
|
||||||
select datistemplate from pg_database where datname = 'regression';
|
select datistemplate from pg_database where datname = 'regression';
|
||||||
|
|
||||||
set citus.log_remote_commands = true;
|
|
||||||
set citus.grep_remote_commands = '%ALTER DATABASE%';
|
DO $$
|
||||||
alter database regression REFRESH COLLATION VERSION;
|
DECLARE
|
||||||
set citus.log_remote_commands = false;
|
v_version_num numeric;
|
||||||
|
BEGIN
|
||||||
|
SELECT current_setting('server_version_num')::numeric INTO v_version_num;
|
||||||
|
IF v_version_num >= 150000 THEN
|
||||||
|
set citus.log_remote_commands = true;
|
||||||
|
set citus.grep_remote_commands = '%ALTER DATABASE%';
|
||||||
|
alter database regression REFRESH COLLATION VERSION;
|
||||||
|
set citus.log_remote_commands = false;
|
||||||
|
ELSE
|
||||||
|
RAISE NOTICE 'Skipping alter database .. REFRESH COLLATION VERSION for PostgreSQL 14';
|
||||||
|
END IF;
|
||||||
|
END;
|
||||||
|
$$;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue