citus/src/backend/distributed/commands
Naisila Puka 75460fa23e
Upgrade uncrustify from 0.68.1 to 0.82.0 (#8373)
This upgrade has changed some indentation levels, moved some
parameter names to the next line etc.
I also did some manual style changes to obey the 88-90 character per
line rule and avoid commas or semicolons in a new line.

Sister PRs https://github.com/citusdata/tools/pull/382
https://github.com/citusdata/the-process/pull/179
2025-12-11 16:51:19 +03:00
..
README.md Make enterprise features open source (#6008) 2022-06-16 00:23:46 -07:00
alter_table.c Upgrade uncrustify from 0.68.1 to 0.82.0 (#8373) 2025-12-11 16:51:19 +03:00
begin.c Rename foreach_ macros to foreach_declared_ macros (#7700) 2025-03-12 11:01:49 +03:00
call.c Sort includes (#7326) 2023-11-23 18:19:54 +01:00
cascade_table_operation_for_connected_relations.c Upgrade uncrustify from 0.68.1 to 0.82.0 (#8373) 2025-12-11 16:51:19 +03:00
citus_add_local_table_to_metadata.c Rename foreach_ macros to foreach_declared_ macros (#7700) 2025-03-12 11:01:49 +03:00
citus_global_signal.c Sort includes (#7326) 2023-11-23 18:19:54 +01:00
cluster.c Rename foreach_ macros to foreach_declared_ macros (#7700) 2025-03-12 11:01:49 +03:00
collation.c Drops PG14 support (#7753) 2025-03-12 12:43:01 +03:00
comment.c Adds comment on database and role propagation (#7388) 2024-01-18 20:58:44 +03:00
common.c Upgrade uncrustify from 0.68.1 to 0.82.0 (#8373) 2025-12-11 16:51:19 +03:00
create_distributed_table.c Upgrade uncrustify from 0.68.1 to 0.82.0 (#8373) 2025-12-11 16:51:19 +03:00
database.c Move stat view implementations into a submodule (#7975) 2025-04-29 14:22:29 +03:00
dependencies.c Rename some more foreach_ptr to foreach_declared_ptr 2025-03-13 15:13:56 +03:00
distribute_object_ops.c Upgrade uncrustify from 0.68.1 to 0.82.0 (#8373) 2025-12-11 16:51:19 +03:00
domain.c Rename foreach_ macros to foreach_declared_ macros (#7700) 2025-03-12 11:01:49 +03:00
drop_distributed_table.c Sort includes (#7326) 2023-11-23 18:19:54 +01:00
extension.c Not automatically create citus_columnar when creating citus extension (#8081) 2025-08-18 08:29:27 +01:00
foreign_constraint.c Upgrade uncrustify from 0.68.1 to 0.82.0 (#8373) 2025-12-11 16:51:19 +03:00
foreign_data_wrapper.c Rename foreach_ macros to foreach_declared_ macros (#7700) 2025-03-12 11:01:49 +03:00
foreign_server.c Rename foreach_ macros to foreach_declared_ macros (#7700) 2025-03-12 11:01:49 +03:00
function.c Upgrade uncrustify from 0.68.1 to 0.82.0 (#8373) 2025-12-11 16:51:19 +03:00
grant.c Upgrade uncrustify from 0.68.1 to 0.82.0 (#8373) 2025-12-11 16:51:19 +03:00
index.c Upgrade uncrustify from 0.68.1 to 0.82.0 (#8373) 2025-12-11 16:51:19 +03:00
index_pg_source.c Fix Semmle errors (#4636) 2021-02-08 18:37:44 +03:00
local_multi_copy.c Sort includes (#7326) 2023-11-23 18:19:54 +01:00
multi_copy.c Upgrade uncrustify from 0.68.1 to 0.82.0 (#8373) 2025-12-11 16:51:19 +03:00
non_main_db_distribute_object_ops.c Upgrade uncrustify from 0.68.1 to 0.82.0 (#8373) 2025-12-11 16:51:19 +03:00
owned.c Adds REASSIGN OWNED BY propagation (#7319) 2023-12-28 15:15:58 +03:00
policy.c Rename foreach_ macros to foreach_declared_ macros (#7700) 2025-03-12 11:01:49 +03:00
publication.c PG18 - Handle publish_generated_columns in distributed publications (#8360) 2025-12-01 09:17:57 +00:00
rename.c Upgrade uncrustify from 0.68.1 to 0.82.0 (#8373) 2025-12-11 16:51:19 +03:00
role.c Rename some more foreach_ptr to foreach_declared_ptr 2025-03-13 15:13:56 +03:00
schema.c Rename foreach_ macros to foreach_declared_ macros (#7700) 2025-03-12 11:01:49 +03:00
schema_based_sharding.c Rename foreach_ macros to foreach_declared_ macros (#7700) 2025-03-12 11:01:49 +03:00
seclabel.c Propagate SECURITY LABEL on tables and columns. (#7956) 2025-04-30 18:03:52 +01:00
sequence.c Upgrade uncrustify from 0.68.1 to 0.82.0 (#8373) 2025-12-11 16:51:19 +03:00
serialize_distributed_ddls.c Upgrade uncrustify from 0.68.1 to 0.82.0 (#8373) 2025-12-11 16:51:19 +03:00
statistics.c Upgrade uncrustify from 0.68.1 to 0.82.0 (#8373) 2025-12-11 16:51:19 +03:00
subscription.c Sort includes (#7326) 2023-11-23 18:19:54 +01:00
table.c Upgrade uncrustify from 0.68.1 to 0.82.0 (#8373) 2025-12-11 16:51:19 +03:00
text_search.c Adds comment on database and role propagation (#7388) 2024-01-18 20:58:44 +03:00
trigger.c Drops PG14 support (#7753) 2025-03-12 12:43:01 +03:00
truncate.c Rename foreach_ macros to foreach_declared_ macros (#7700) 2025-03-12 11:01:49 +03:00
type.c Sort includes (#7326) 2023-11-23 18:19:54 +01:00
utility_hook.c Upgrade uncrustify from 0.68.1 to 0.82.0 (#8373) 2025-12-11 16:51:19 +03:00
vacuum.c PG18 – Respect VACUUM/ANALYZE ONLY semantics for Citus tables (#8365) 2025-12-05 16:50:42 +03:00
variableset.c Sort includes (#7326) 2023-11-23 18:19:54 +01:00
view.c Rename foreach_ macros to foreach_declared_ macros (#7700) 2025-03-12 11:01:49 +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.