citus/src/backend/distributed/commands
Onur Tirtir f68fc9e69c
Decide core distribution params in CreateCitusTable (#6760)
Decide core distribution params in CreateCitusTable to reduce the
chances of
creating Citus tables based on incorrect combinations of distribution
method
and replication model params.

Also introduce DistributedTableParams struct to encapsulate the
parameters
that are specific to distributed tables.
2023-03-14 14:24:52 +03:00
..
README.md Make enterprise features open source (#6008) 2022-06-16 00:23:46 -07:00
alter_table.c Refactor CreateDistributedTable() (#6742) 2023-03-08 13:38:51 +03: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 Fix regression in allowed foreign keys on distributed tables (#6550) 2023-01-24 16:09:21 +03:00
citus_add_local_table_to_metadata.c fix dropping table_name option from foreign table (#6669) 2023-01-30 17:24:30 +03:00
citus_global_signal.c Don't override postgres C symbols with our own (#6300) 2022-09-07 11:27:05 +02:00
cluster.c Add warning messages for cluster commands on partitioned tables (#6306) 2022-09-13 00:05:58 +03:00
collation.c Pg15 support (#6085) 2022-08-24 17:59:17 +02:00
common.c address method should take parameter isPostprocess 2022-08-02 21:00:23 +03:00
create_distributed_table.c Decide core distribution params in CreateCitusTable (#6760) 2023-03-14 14:24:52 +03:00
database.c address method should take parameter isPostprocess 2022-08-02 21:00:23 +03:00
dependencies.c Identity Column Support on Citus Managed Tables (#6591) 2023-01-19 15:45:41 +03:00
distribute_object_ops.c fix the problem #5763 (#6519) 2022-12-02 13:49:32 +01:00
domain.c we validate constraint as well if the statement is alter domain drop constraint (#6125) 2022-08-03 23:06:33 +03:00
drop_distributed_table.c Revert "Revert "Creates new colocation for colocate_with:='none' too"" (#6227) 2022-08-24 10:54:04 +03:00
extension.c [Columnar] Check for existence of Citus before creating Citus_Columnar (#6178) 2022-08-17 15:12:42 -07:00
foreign_constraint.c Replace CITUS_TABLE_WITH_NO_DIST_KEY checks with HasDistributionKey() (#6743) 2023-03-10 13:55:52 +03: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 Fix uninit mem acceess in UpdateFunctionDistributionInfo (#6658) 2023-01-27 11:00:41 +03: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 Replace CITUS_TABLE_WITH_NO_DIST_KEY checks with HasDistributionKey() (#6743) 2023-03-10 13:55:52 +03: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 Replace CITUS_TABLE_WITH_NO_DIST_KEY checks with HasDistributionKey() (#6743) 2023-03-10 13:55:52 +03: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
rename.c * alter index/table rename weird syntax supported, 2022-07-04 21:27:47 +03:00
role.c Grammar: it's to its 2022-11-28 20:43:44 +00:00
schema.c Do not propagate GRANT ON SCHEMA from CREATE EXTENSION (#6175) 2022-08-19 13:23:47 +03:00
sequence.c Grammar: it's to its 2022-11-28 20:43:44 +00:00
statistics.c address method should take parameter isPostprocess 2022-08-02 21:00:23 +03:00
subscription.c Remove useless version compats 2022-07-29 10:31:55 +02:00
table.c Replace CITUS_TABLE_WITH_NO_DIST_KEY checks with HasDistributionKey() (#6743) 2023-03-10 13:55:52 +03:00
text_search.c address method should take parameter isPostprocess 2022-08-02 21:00:23 +03:00
trigger.c Make sure to disallow triggers that depend on extensions (#6399) 2022-11-02 16:27:31 +03:00
truncate.c Replace CITUS_TABLE_WITH_NO_DIST_KEY checks with HasDistributionKey() (#6743) 2023-03-10 13:55:52 +03:00
type.c address method should take parameter isPostprocess 2022-08-02 21:00:23 +03:00
utility_hook.c Stop background daemon before dropping the database (#6688) 2023-02-03 15:15:44 +03:00
vacuum.c Drop postgres 12 support (#6040) 2022-07-20 17:49:36 +03:00
variableset.c Introduce a new GUC to propagate local settings to new connections in rebalancer (#6396) 2022-10-18 12:50:30 +03:00
view.c stop distributing views with no distributed dependency if GUC DistributeLocalViews is set false. (#6083) 2022-08-04 12:34:40 +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 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.