citus/src/backend/distributed/commands
Onur Tirtir 3a403090fd
Disallow adding local table with identity column to metadata (#4633)
pg_get_tableschemadef_string doesn't know how to deparse identity
columns so we cannot reflect those columns when creating shell
relation.
For this reason, we don't allow adding local tables -having identity cols-
to metadata.
2021-02-03 19:05:17 +03:00
..
README.md Fix some more master->coordinator comments 2020-07-07 10:37:53 +02:00
alter_table.c Skip copying GENERATED ALWAYS AS STORED cols in ReplaceTable (#4616) 2021-02-03 17:55:16 +03:00
call.c Improve the robustness of function call delegation 2020-09-21 14:53:30 +02:00
cascade_table_operation_for_connected_relations.c Rename create_citus_local_table to citus_add_local_table_to_metadata 2021-01-27 15:52:36 +03:00
citus_add_local_table_to_metadata.c Disallow adding local table with identity column to metadata (#4633) 2021-02-03 19:05:17 +03:00
cluster.c Pass ProcessUtilityContext to .preprocess 2021-01-14 17:12:00 +03:00
collation.c Pass ProcessUtilityContext to .preprocess 2021-01-14 17:12:00 +03:00
create_distributed_table.c Disallow adding local table with identity column to metadata (#4633) 2021-02-03 19:05:17 +03:00
dependencies.c Propagate create statistics 2020-12-17 20:38:36 +03:00
distribute_object_ops.c Propagate alter stats owner 2020-12-24 17:10:12 +03:00
drop_distributed_table.c Automatically undistribute citus local tables when no more fkeys with reference tables (#4538) 2021-01-22 18:15:41 +03:00
extension.c Pass ProcessUtilityContext to .preprocess 2021-01-14 17:12:00 +03:00
foreign_constraint.c Advise dropping foreign key in addition to create_reference_table hint (#4590) 2021-01-27 17:59:06 +03:00
function.c Reland #4419 2021-01-19 07:48:47 -08:00
grant.c Pass ProcessUtilityContext to .preprocess 2021-01-14 17:12:00 +03:00
index.c Pass ProcessUtilityContext to .preprocess 2021-01-14 17:12:00 +03:00
index_pg_source.c Switch to sequential execution if the index name is long (#4209) 2020-10-02 13:39:34 +03:00
local_multi_copy.c Use table_openXXX methods in the codebase 2020-08-04 15:10:22 +03:00
multi_copy.c When reaches to shared pool size, COPY sets the placement access 2021-01-28 12:45:57 +01:00
policy.c Pass ProcessUtilityContext to .preprocess 2021-01-14 17:12:00 +03:00
rename.c Pass ProcessUtilityContext to .preprocess 2021-01-14 17:12:00 +03:00
role.c Don't propagate ALTER ROLE SET when scoped to a different database (#4471) 2021-02-01 15:49:26 +03:00
schema.c Pass ProcessUtilityContext to .preprocess 2021-01-14 17:12:00 +03:00
sequence.c Rename ExtractColumnsOwningSequences 2021-02-02 18:17:42 +03:00
statistics.c Fix bug creating citus local table with stats 2021-01-20 17:17:13 +03:00
subscription.c Remove copyright years (#2918) 2019-10-15 17:44:30 +03:00
table.c Not mention citus local tables in error messages (#4579) 2021-01-27 12:36:53 +03:00
transmit.c Replace foreach with foreach_ptr/foreach_oid (#3544) 2020-02-27 16:54:49 +01:00
trigger.c Not mention citus local tables in error messages (#4579) 2021-01-27 12:36:53 +03:00
truncate.c Remove the word 'master' from Citus UDFs (#4472) 2021-01-13 12:10:43 +03:00
type.c Pass ProcessUtilityContext to .preprocess 2021-01-14 17:12:00 +03:00
utility_hook.c Rename create_citus_local_table to citus_add_local_table_to_metadata 2021-01-27 15:52:36 +03:00
vacuum.c Return early if there is no citus table in VACUUM 2020-10-09 11:10:00 +03:00
variableset.c Fix Subtransaction memory leak 2020-07-09 12:33:39 -07: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 incomming 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.