-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
28612: cli,sql: improve the UX for viewing and updating zone configurations r=knz a=knz Fixes #23791. Summary of visible changes: - new statement forms: - `ALTER ... CONFIGURE ZONE USING num_replicas = 123, ...` to edit a zone config. The compact constraint syntax is still supported, e.g. `USING constraints = '[+foo]'`. - `ALTER ... CONFIGURE ZONE USING DEFAULT` to reset a zone config to inherited defaults - `ALTER ... CONFIGURE ZONE DISCARD` to remove a zone config - compatibility forms with previous versions of CockroachDB, probably should not be documented but will ease transition: - `ALTER ... CONFIGURE ZONE = '...yaml...'` to set multiple zone parameters at once using YAML - `ALTER ... CONFIGURE ZONE = ''` ensures the zone config exists but is otherwise a no-op (it does not reset it to defaults if it already existed) - `ALTER ... CONFIGURE ZONE = NULL` to remove a zone config - the `ALTER ... CONFIGURE ZONE` statement forms now can be prepared on pgwire and accept placeholders. - `crdb_internal.zones` and `SHOW ZONE CONFIGURATION(s)` have a new column `config_sql` in addition to the existing `config_yaml` and `config_protobuf`. This new columns reports the ALTER syntax that reproduces the zone config with the new syntax. - `cockroach zone` sub-commands are now deprecated. - `cockroach zone rm` now prints no output unless there is an error. Co-authored-by: Raphael 'kena' Poss <knz@cockroachlabs.com>
- Loading branch information
Showing
55 changed files
with
1,315 additions
and
560 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
set_stmt ::= | ||
'SET' ( 'SESSION' | ) var_name 'TO' var_value ( ( ',' var_value ) )* | ||
| 'SET' ( 'SESSION' | ) var_name '=' var_value ( ( ',' var_value ) )* | ||
'SET' ( 'SESSION' | ) var_name '=' var_value ( ( ',' var_value ) )* | ||
| 'SET' ( 'SESSION' | ) var_name 'TO' var_value ( ( ',' var_value ) )* | ||
| set_csetting_stmt | ||
| set_transaction_stmt | ||
| use_stmt |
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 |
---|---|---|
|
@@ -17,3 +17,4 @@ show_stmt ::= | |
| show_tables_stmt | ||
| show_trace_stmt | ||
| show_users_stmt | ||
| show_zone_stmt |
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
Oops, something went wrong.