Commit Graph

66 Commits (9d7e601e1d597b235836ced232dc9918cbf072b6)

Author SHA1 Message Date
gindibay 9d7e601e1d Fixes review notes 2023-11-21 23:36:32 +03:00
gindibay a1ab60f5ad Merge branch 'main' into alter_database_additional_options 2023-11-20 14:40:52 +03:00
Gürkan İndibay 3b556cb5ed
Adds create / drop database propagation support (#7240)
DESCRIPTION: Adds support for propagating `CREATE`/`DROP` database

In this PR, create and drop database support is added.

For CREATE DATABASE:
* "oid" option is not supported
* specifying "strategy" to be different than "wal_log" is not supported
* specifying "template" to be different than "template1" is not
supported

The last two are because those are not saved in `pg_database` and when
activating a node, we cannot assume what parameters were provided when
creating the database.

And "oid" is not supported because whether user specified an arbitrary
oid when creating the database is not saved in pg_database and we want
to avoid from oid collisions that might arise from attempting to use an
auto-assigned oid on workers.

Finally, in case of node activation, GRANTs for the database are also
propagated.

---------

Co-authored-by: Jelte Fennema-Nio <github-tech@jeltef.nl>
Co-authored-by: Jelte Fennema-Nio <jelte.fennema@microsoft.com>
Co-authored-by: Onur Tirtir <onurcantirtir@gmail.com>
2023-11-21 16:43:51 +03:00
gindibay c123fc38ec Fixes indentation 2023-11-20 00:57:38 +03:00
gindibay 2207846d48 Fixes warning 2023-11-20 00:36:53 +03:00
Gürkan İndibay 7794aab38c
Merge branch 'create_alter_database' into alter_database_additional_options 2023-11-20 11:16:21 +03:00
gindibay cf019b858c Adds static declarations 2023-11-14 10:21:23 +03:00
Gürkan İndibay 1e044a217d
Update src/backend/distributed/deparser/deparse_database_stmts.c
Co-authored-by: Onur Tirtir <onurcantirtir@gmail.com>
2023-11-13 19:00:01 +03:00
Gürkan İndibay a956786bd8
Update src/backend/distributed/deparser/deparse_database_stmts.c
Co-authored-by: Onur Tirtir <onurcantirtir@gmail.com>
2023-11-13 18:59:48 +03:00
gindibay a9977e8840 Moves validation to preprocess for createdb 2023-11-13 15:49:19 +03:00
gindibay 712fd8ebf3 Fixes comments 2023-11-13 14:23:37 +03:00
gindibay 3731c45c29 Fixes drop force option 2023-11-13 14:19:19 +03:00
Onur Tirtir 1a80181a9c indent 2023-11-13 13:42:11 +03:00
Onur Tirtir 69217678b3 allow wal_log option only if it's set to default 2023-11-13 12:16:08 +03:00
gindibay a35cae0ed7 Fixes review issues 2023-11-13 12:07:40 +03:00
gindibay 30e1a858d2 Removes oid support 2023-11-13 11:41:58 +03:00
gindibay f8b3f322aa Fixed review items 2023-11-10 08:33:51 +03:00
gindibay 1b9a8ea2db Fixes indentation 2023-11-10 06:11:43 +03:00
gindibay b5424db419 Fixes compilation errors 2023-11-10 05:46:30 +03:00
gindibay b45543f51b Merge remote-tracking branch 'origin/create_alter_database' into alter_database_additional_options 2023-11-10 05:38:19 +03:00
gindibay 5f4092db5b Adds validation for template 2023-11-09 12:11:22 +03:00
gindibay 4c9863c0fb Fixes review comments 2023-11-09 01:49:43 +03:00
gindibay 65660db10d Fixes review items 2023-11-08 02:02:00 +03:00
gindibay 328e34969d Fixes review notes 2023-10-31 13:41:50 +03:00
gindibay 75f1e691c1 Merge branch 'create_alter_database' into alter_database_additional_options 2023-10-31 11:22:52 +03:00
gindibay 2d9181a9ab Fixes indents 2023-10-31 11:00:40 +03:00
gindibay d8639d58de Adds locale restrictions 2023-10-31 10:58:44 +03:00
gindibay ef920b0252 Fixes compile errors 2023-10-13 14:49:34 +03:00
Gürkan İndibay c3a9a37ae2
Merge branch 'create_alter_database' into alter_database_additional_options 2023-10-16 14:44:32 +03:00
gindibay c31479d2eb Fixes review notes 2023-10-13 14:17:14 +03:00
gindibay a274ffcb51 Adds If exists statement for drop database 2023-10-13 14:17:14 +03:00
gindibay 875f347238 Fixes indentation 2023-10-13 14:17:14 +03:00
gindibay f2092d2f44 Clarifies the code 2023-10-13 14:17:14 +03:00
gindibay 6096a0ed57 Adds missing types 2023-10-13 14:17:14 +03:00
gindibay e7f8058016 Removes T_Boolean since it breaks pg14 compile 2023-10-13 14:17:14 +03:00
gindibay 0bf1c2c139 Refactors the code to make more managable 2023-10-13 14:17:13 +03:00
gindibay a5e0b9411a Adds tests for create and drop database 2023-10-13 14:17:13 +03:00
gindibay cef9ac702e Fixes indentation 2023-10-13 14:17:13 +03:00
gindibay bd398a627b Fixes compile errors 2023-10-13 14:16:43 +03:00
gindibay 0d5c2f9350 Adds first commit 2023-10-13 14:16:43 +03:00
gindibay cd4ffd1878 Fixes merge errors 2023-10-13 06:16:12 +03:00
Gürkan İndibay c38e856f13
Merge branch 'create_alter_database' into alter_database_additional_options 2023-10-14 08:15:45 +03:00
gindibay 761fb13ac8 Fixes review notes 2023-10-13 03:10:17 +03:00
gindibay e5a6b7880c Adds If exists statement for drop database 2023-10-13 01:36:01 +03:00
gindibay 8d6d27a241 Adds set tablespace support 2023-10-12 19:06:27 +03:00
gindibay 80e450b860 Adds tests 2023-10-11 20:21:08 +03:00
gindibay 959d26db89 Fixes code indents 2023-10-11 20:01:12 +03:00
gindibay 6a333ca742 Adds alter database rename stmt propagation 2023-10-11 19:59:33 +03:00
gindibay fd521f2792 Fixes indentation 2023-10-11 18:09:45 +03:00
gindibay 37d2a5f5a8 Adds seperate set tablespace on each node support 2023-10-11 18:09:00 +03:00