mirror of https://github.com/citusdata/citus.git
80 lines
4.8 KiB
Plaintext
80 lines
4.8 KiB
Plaintext
set citus.log_remote_commands = true;
|
|
set citus.grep_remote_commands = '%ALTER DATABASE%';
|
|
--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_initial numeric;
|
|
v_connlimit_fetched int;
|
|
begin
|
|
select datconnlimit into v_connlimit_initial 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_initial: %, v_connlimit_fetched: %', v_connlimit_initial, v_connlimit_fetched;
|
|
execute 'alter database regression with CONNECTION LIMIT ' || v_connlimit_initial;
|
|
select datconnlimit into v_connlimit_fetched from pg_database where datname = 'regression';
|
|
raise notice 'v_connlimit_initial: %, v_connlimit_fetched: %', v_connlimit_initial, v_connlimit_fetched;
|
|
|
|
alter database regression with IS_TEMPLATE true CONNECTION LIMIT 100;
|
|
execute 'alter database regression with IS_TEMPLATE false CONNECTION LIMIT' || v_connlimit_initial;
|
|
|
|
alter database regression with IS_TEMPLATE true;
|
|
select datistemplate from pg_database where datname = 'regression';
|
|
|
|
alter database regression with IS_TEMPLATE false;
|
|
select datistemplate from pg_database where datname = 'regression';
|
|
end;
|
|
$$
|
|
language plpgsql;
|
|
NOTICE: issuing ALTER DATABASE regression WITH CONNECTION LIMIT 100;
|
|
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
|
|
CONTEXT: SQL statement "alter database regression with CONNECTION LIMIT 100"
|
|
PL/pgSQL function inline_code_block line XX at SQL statement
|
|
NOTICE: issuing ALTER DATABASE regression WITH CONNECTION LIMIT 100;
|
|
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
|
|
CONTEXT: SQL statement "alter database regression with CONNECTION LIMIT 100"
|
|
PL/pgSQL function inline_code_block line XX at SQL statement
|
|
NOTICE: v_connlimit_initial: -1, v_connlimit_fetched: 100
|
|
CONTEXT: PL/pgSQL function inline_code_block line XX at RAISE
|
|
NOTICE: issuing ALTER DATABASE regression WITH CONNECTION LIMIT -1;
|
|
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
|
|
CONTEXT: SQL statement "alter database regression with CONNECTION LIMIT -1"
|
|
PL/pgSQL function inline_code_block line XX at EXECUTE
|
|
NOTICE: issuing ALTER DATABASE regression WITH CONNECTION LIMIT -1;
|
|
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
|
|
CONTEXT: SQL statement "alter database regression with CONNECTION LIMIT -1"
|
|
PL/pgSQL function inline_code_block line XX at EXECUTE
|
|
NOTICE: v_connlimit_initial: -1, v_connlimit_fetched: -1
|
|
CONTEXT: PL/pgSQL function inline_code_block line XX at RAISE
|
|
NOTICE: issuing ALTER DATABASE regression WITH is_template 'true' CONNECTION LIMIT 100;
|
|
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
|
|
CONTEXT: SQL statement "alter database regression with IS_TEMPLATE true CONNECTION LIMIT 100"
|
|
PL/pgSQL function inline_code_block line XX at SQL statement
|
|
NOTICE: issuing ALTER DATABASE regression WITH is_template 'true' CONNECTION LIMIT 100;
|
|
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
|
|
CONTEXT: SQL statement "alter database regression with IS_TEMPLATE true CONNECTION LIMIT 100"
|
|
PL/pgSQL function inline_code_block line XX at SQL statement
|
|
NOTICE: issuing ALTER DATABASE regression WITH is_template 'false' CONNECTION LIMIT -1;
|
|
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
|
|
CONTEXT: SQL statement "alter database regression with IS_TEMPLATE false CONNECTION LIMIT-1"
|
|
PL/pgSQL function inline_code_block line XX at EXECUTE
|
|
NOTICE: issuing ALTER DATABASE regression WITH is_template 'false' CONNECTION LIMIT -1;
|
|
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
|
|
CONTEXT: SQL statement "alter database regression with IS_TEMPLATE false CONNECTION LIMIT-1"
|
|
PL/pgSQL function inline_code_block line XX at EXECUTE
|
|
NOTICE: issuing ALTER DATABASE regression WITH is_template 'true';
|
|
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
|
|
CONTEXT: SQL statement "alter database regression with IS_TEMPLATE true"
|
|
PL/pgSQL function inline_code_block line XX at SQL statement
|
|
NOTICE: issuing ALTER DATABASE regression WITH is_template 'true';
|
|
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
|
|
CONTEXT: SQL statement "alter database regression with IS_TEMPLATE true"
|
|
PL/pgSQL function inline_code_block line XX at SQL statement
|
|
ERROR: query has no destination for result data
|
|
HINT: If you want to discard the results of a SELECT, use PERFORM instead.
|
|
CONTEXT: PL/pgSQL function inline_code_block line XX at SQL statement
|
|
set citus.log_remote_commands = false;
|