citus/src/backend/distributed/commands
Marco Slot 7abcfac61f Add caching for functions that check the backend type 2022-05-20 19:02:37 +02:00
..
README.md Fix typos. Spurred spotting "connectios" in logs 2021-10-25 13:54:09 +00:00
alter_table.c Columnar: support relation options with ALTER TABLE. (#5935) 2022-05-20 08:35:00 -07:00
call.c Add caching for functions that check the backend type 2022-05-20 19:02:37 +02:00
cascade_table_operation_for_connected_relations.c Dont auto-undistribute user-added citus local tables (#5314) 2021-10-28 12:10:26 +03:00
citus_add_local_table_to_metadata.c Add versions of forboth that don't need ListCell (#5856) 2022-03-23 14:50:36 +03:00
citus_global_signal.c Allow distributed execution from run_command_on_* functions 2022-05-20 15:26:47 +02:00
cluster.c Pass ProcessUtilityContext to .preprocess 2021-01-14 17:12:00 +03:00
collation.c Refactor: reduce complexity and code duplication for Object Propagation 2022-05-18 15:58:28 +02:00
common.c Refactor: reduce complexity and code duplication for Object Propagation 2022-05-18 15:58:28 +02:00
create_distributed_table.c Revert "Creates new colocation for colocate_with:='none' too" 2022-05-17 15:32:22 +03:00
database.c Refactor: reduce complexity and code duplication for Object Propagation 2022-05-18 15:58:28 +02:00
dependencies.c Refactor: reduce complexity and code duplication for Object Propagation 2022-05-18 15:58:28 +02:00
distribute_object_ops.c Refactor: reduce complexity and code duplication for Object Propagation 2022-05-18 15:58:28 +02:00
domain.c Refactor: reduce complexity and code duplication for Object Propagation 2022-05-18 15:58:28 +02:00
drop_distributed_table.c Revert "Creates new colocation for colocate_with:='none' too" 2022-05-17 15:32:22 +03:00
extension.c Mark existing views as distributed when upgrade to 11.0+ 2022-05-18 15:43:17 +02:00
foreign_constraint.c Fix an incorrect error message related with fkeys between replicated dist tables (#5796) 2022-03-14 14:34:09 +01:00
foreign_server.c Refactor: reduce complexity and code duplication for Object Propagation 2022-05-18 15:58:28 +02:00
function.c Refactor: reduce complexity and code duplication for Object Propagation 2022-05-18 15:58:28 +02:00
grant.c Pass ProcessUtilityContext to .preprocess 2021-01-14 17:12:00 +03:00
index.c Fixes a bug that prevents dropping/altering indexes 2022-05-18 16:35:17 +02:00
index_pg_source.c Fix Semmle errors (#4636) 2021-02-08 18:37:44 +03:00
local_multi_copy.c Fix style 2021-09-03 16:09:59 +03:00
multi_copy.c Improve nested execution checks and add GUC to disable 2022-05-20 18:55:43 +02:00
policy.c Pass ProcessUtilityContext to .preprocess 2021-01-14 17:12:00 +03:00
rename.c Add ALTER VIEW support 2022-05-13 13:21:53 +03:00
role.c PG15: Value -> String, Integer, Float. 2022-05-02 10:12:03 -07:00
schema.c Refactor: reduce complexity and code duplication for Object Propagation 2022-05-18 15:58:28 +02:00
sequence.c Fix schema name bug for sequences (#5937) 2022-05-16 18:11:57 +03:00
statistics.c Use object address instead of relation id on DDLJob to decide on syncing metadata 2022-05-05 17:59:44 +03:00
subscription.c Remove copyright years (#2918) 2019-10-15 17:44:30 +03:00
table.c Add ALTER VIEW support 2022-05-13 13:21:53 +03:00
text_search.c Refactor: reduce complexity and code duplication for Object Propagation 2022-05-18 15:58:28 +02:00
trigger.c Use object address instead of relation id on DDLJob to decide on syncing metadata 2022-05-05 17:59:44 +03:00
truncate.c Add distributing lock command support 2022-05-20 12:28:07 +03:00
type.c Refactor: reduce complexity and code duplication for Object Propagation 2022-05-18 15:58:28 +02:00
utility_hook.c Add caching for functions that check the backend type 2022-05-20 19:02:37 +02:00
vacuum.c PG15: Value -> String, Integer, Float. 2022-05-02 10:12:03 -07:00
variableset.c Hide shards from application_name's with a specific prefix 2022-01-18 15:20:55 +04:00
view.c Add distributing lock command support 2022-05-20 12:28:07 +03: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 helper functions for foreign key constraints
grant.c Placeholder for code granting users access to relations, implemented as enterprise feature
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.