-
Notifications
You must be signed in to change notification settings - Fork 685
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds alter database propagation - with and refresh collation (#7172)
DESCRIPTION: Adds ALTER DATABASE WITH ... and REFRESH COLLATION VERSION support This PR adds supports for basic ALTER DATABASE statements propagation support. Below statements are supported: ALTER DATABASE <database_name> with IS_TEMPLATE <true/false>; ALTER DATABASE <database_name> with CONNECTION LIMIT <integer_value>; ALTER DATABASE <database_name> REFRESH COLLATION VERSION; --------- Co-authored-by: Jelte Fennema-Nio <jelte.fennema@microsoft.com>
- Loading branch information
1 parent
1da99f8
commit e5e64b7
Showing
10 changed files
with
262 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
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 | ||
alter database regression with CONNECTION LIMIT 100; | ||
NOTICE: issuing ALTER DATABASE regression WITH CONNECTION LIMIT 100; | ||
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx | ||
NOTICE: issuing ALTER DATABASE regression WITH CONNECTION LIMIT 100; | ||
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx | ||
alter database regression with IS_TEMPLATE true CONNECTION LIMIT 50; | ||
NOTICE: issuing ALTER DATABASE regression WITH IS_TEMPLATE 'true' CONNECTION LIMIT 50; | ||
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx | ||
NOTICE: issuing ALTER DATABASE regression WITH IS_TEMPLATE 'true' CONNECTION LIMIT 50; | ||
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx | ||
alter database regression with CONNECTION LIMIT -1; | ||
NOTICE: issuing ALTER DATABASE regression WITH CONNECTION LIMIT -1; | ||
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx | ||
NOTICE: issuing ALTER DATABASE regression WITH CONNECTION LIMIT -1; | ||
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx | ||
alter database regression with IS_TEMPLATE true; | ||
NOTICE: issuing ALTER DATABASE regression WITH IS_TEMPLATE 'true'; | ||
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx | ||
NOTICE: issuing ALTER DATABASE regression WITH IS_TEMPLATE 'true'; | ||
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx | ||
alter database regression with IS_TEMPLATE false; | ||
NOTICE: issuing ALTER DATABASE regression WITH IS_TEMPLATE 'false'; | ||
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx | ||
NOTICE: issuing ALTER DATABASE regression WITH IS_TEMPLATE 'false'; | ||
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx | ||
-- this statement will get error since we don't have a multiple database support for now | ||
alter database regression rename to regression2; | ||
ERROR: current database cannot be renamed | ||
set citus.log_remote_commands = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
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; | ||
|
||
|
||
alter database regression with CONNECTION LIMIT 100; | ||
alter database regression with IS_TEMPLATE true CONNECTION LIMIT 50; | ||
alter database regression with CONNECTION LIMIT -1; | ||
alter database regression with IS_TEMPLATE true; | ||
alter database regression with IS_TEMPLATE false; | ||
-- this statement will get error since we don't have a multiple database support for now | ||
alter database regression rename to regression2; | ||
|
||
set citus.log_remote_commands = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters