citus/src/backend/distributed/commands
Gürkan İndibay 8411d0dd48 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>
2023-11-13 13:29:10 -05:00
..
README.md Make enterprise features open source (#6008) 2022-06-16 00:23:46 -07:00
alter_table.c Add citus_schema_move() function (#7180) 2023-11-13 13:28:54 -05:00
begin.c Propagate BEGIN properties to worker nodes (#6483) 2022-11-10 18:08:43 +01:00
call.c Remove useless version compats 2022-07-29 10:31:55 +02:00
cascade_table_operation_for_connected_relations.c ALTER TABLE <tblname> SET SCHEMA <schemaname> for single shard tables (#7004) 2023-06-19 10:21:13 +03:00
citus_add_local_table_to_metadata.c PG16 - Add citus_truncate_trigger for Citus foreign tables (#7170) 2023-11-13 13:28:54 -05:00
citus_global_signal.c Drop PG13 Support Phase 2 - Remove PG13 specific paths/tests (#7007) 2023-06-21 14:18:23 +03:00
cluster.c Drop PG13 Support Phase 2 - Remove PG13 specific paths/tests (#7007) 2023-06-21 14:18:23 +03:00
collation.c PG16 - Add rules option to CREATE COLLATION (#7185) 2023-11-13 13:28:54 -05:00
common.c address method should take parameter isPostprocess 2022-08-02 21:00:23 +03:00
create_distributed_table.c PG16 - Add citus_truncate_trigger for Citus foreign tables (#7170) 2023-11-13 13:28:54 -05:00
database.c Adds alter database propagation - with and refresh collation (#7172) 2023-11-13 13:29:10 -05:00
dependencies.c Fixes visibility problems with dependency propagation (#7028) 2023-11-13 13:28:54 -05:00
distribute_object_ops.c Adds alter database propagation - with and refresh collation (#7172) 2023-11-13 13:29:10 -05:00
domain.c PG16 compatibility: Resolve compilation issues (#7005) 2023-07-21 14:32:37 +03:00
drop_distributed_table.c Add citus_schema_move() function (#7180) 2023-11-13 13:28:54 -05:00
extension.c get rid of {Push/Pop}OverrideSearchPath (#7145) 2023-11-13 13:28:54 -05:00
foreign_constraint.c get rid of {Push/Pop}OverrideSearchPath (#7145) 2023-11-13 13:28:54 -05:00
foreign_data_wrapper.c refactor code where GetObjectAddressFromParseTree is called because it returns list of addresses now 2022-07-19 18:13:12 +03:00
foreign_server.c address method should take parameter isPostprocess 2022-08-02 21:00:23 +03:00
function.c get rid of {Push/Pop}OverrideSearchPath (#7145) 2023-11-13 13:28:54 -05:00
grant.c refactor code where GetObjectAddressFromParseTree is called because it returns list of addresses now 2022-07-19 18:13:12 +03:00
index.c Adds PG16Beta3 support (#6952) 2023-08-17 21:02:59 +03:00
index_pg_source.c Fix Semmle errors (#4636) 2021-02-08 18:37:44 +03:00
local_multi_copy.c Drop PG13 Support Phase 2 - Remove PG13 specific paths/tests (#7007) 2023-06-21 14:18:23 +03:00
multi_copy.c polish the codebase by fixing dozens of typos (#7166) 2023-11-13 13:28:25 -05:00
owned.c fix the problem #5763 (#6519) 2022-12-02 13:49:32 +01:00
policy.c Enable ALTER TABLE ... ADD CHECK (#6606) 2023-01-12 23:31:06 +03:00
publication.c Propagate CREATE PUBLICATION statements 2023-03-29 00:59:12 +02:00
rename.c * alter index/table rename weird syntax supported, 2022-07-04 21:27:47 +03:00
role.c PG16 - Don't propagate GRANT ROLE with INHERIT/SET option (#7190) 2023-11-13 13:29:10 -05:00
schema.c Fix ScanKeyInit RegProcedure and Datum arguments (#7072) 2023-07-21 14:11:10 +03:00
schema_based_sharding.c Add citus_schema_move() function (#7180) 2023-11-13 13:28:54 -05:00
sequence.c Drop PG13 Support Phase 2 - Remove PG13 specific paths/tests (#7007) 2023-06-21 14:18:23 +03:00
statistics.c get rid of {Push/Pop}OverrideSearchPath (#7145) 2023-11-13 13:28:54 -05:00
subscription.c Remove useless version compats 2022-07-29 10:31:55 +02:00
table.c Not undistribute Citus local table when converting it to a reference table / single-shard table 2023-08-29 12:57:28 +03:00
text_search.c address method should take parameter isPostprocess 2022-08-02 21:00:23 +03:00
trigger.c get rid of {Push/Pop}OverrideSearchPath (#7145) 2023-11-13 13:28:54 -05:00
truncate.c PG16 compatibility: Resolve compilation issues (#7005) 2023-07-21 14:32:37 +03:00
type.c PG16 compatibility: Resolve compilation issues (#7005) 2023-07-21 14:32:37 +03:00
utility_hook.c Fixes visibility problems with dependency propagation (#7028) 2023-11-13 13:28:54 -05:00
vacuum.c PG16 compatibility - new options to vacuum and analyze (#7114) 2023-08-16 16:18:28 +03:00
variableset.c Remove AssertArg and AssertState (#6970) 2023-06-05 13:25:21 +03:00
view.c get rid of {Push/Pop}OverrideSearchPath (#7145) 2023-11-13 13:28:54 -05:00

README.md

Commands

The commands module is modeled after backend/commands from the postgres repository and contains the logic for Citus on how to run these commands on distributed objects. Even though the structure of the directory has some resemblence to its postgres relative, files here are somewhat more fine-grained. This is due to the nature of citus commands that are heavily focused on distributed tables. Instead of having all commands in tablecmds.c they are often moved to files that are named after the command.

File Description
create_distributed_table.c Implementation of UDF's for creating distributed tables
drop_distributed_table.c Implementation for dropping metadata for partitions of distributed tables
extension.c Implementation of CREATE EXTENSION commands for citus specific checks
foreign_constraint.c Implementation of and helper functions for foreign key constraints
grant.c Implementation of GRANT commands for roles/users on relations
index.c Implementation of commands specific to indices on distributed tables
multi_copy.c Implementation of COPY command. There are multiple different copy modes which are described in detail below
policy.c Implementation of CREATE\ALTER POLICY commands.
rename.c Implementation of ALTER ... RENAME ... commands. It implements the renaming of applicable objects, otherwise provides the user with a warning
schema.c
sequence.c Implementation of CREATE/ALTER SEQUENCE commands. Primarily checks correctness of sequence statements as they are not propagated to the worker nodes
table.c
transmit.c Implementation of COPY commands with format transmit set in the options. This format is used to transfer files from one node to another node
truncate.c Implementation of TRUNCATE commands on distributed tables
utility_hook.c This is the entry point from postgres into the commands module of citus. It contains the implementation that gets registered in postgres' ProcessUtility_hook callback to extends the functionality of the original ProcessUtility. This code is used to route the incoming commands to their respective implementation in Citus
vacuum.c Implementation of VACUUM commands on distributed tables

COPY

The copy command is overloaded for a couple of use-cases specific to citus. The syntax of the command stays the same, however the implementation might slightly differ from the stock implementation. The overloading is mostly done via extra options that Citus uses to indicate how to operate the copy. The options used are described below.

FORMAT transmit

Implemented in transmit.c

TODO: to be written by someone with enough knowledge to write how, when and why it is used.

FORMAT result

Implemented in multi_copy.c

TODO: to be written by someone with enough knowledge to write how, when and why it is used.