citusdata / citusdata/citus

DDL Support

Open
#4,812 1 comment 1 reaction 0 assignees View on GitHub
DDL
Dominant language
C
Stars
12.8k
Forks
794
Avg merge
2d 14h
Merged PRs (30d)
31

Description

The following DDL/utility commands are currently not propagated to worker nodes by Citus:

Database-level statements:

- [x] ANALYZE -- only propagated on tables
- [ ] COMMENT
- [x] ALTER/CREATE/DROP DOMAIN https://github.com/citusdata/citus/issues/4200
- [x] ALTER/CREATE/DROP FUNCTION -- currently requires create_distributed_function
- [x] ALTER/CREATE/DROP SEQUENCE -- only propagated when created via serial column. So, a minor tech debt
- [ ] ALTER DEFAULT PRIVILEGES https://github.com/citusdata/citus/issues/7144
- [x] GRANT/REVOKE on database objects other than on tables and schemas (type, function, sequence, ...)
- [ ] GRANT/REVOKE ... (COLUMN) ON TABLE TO ROLE #7287
- [x] SECURITY LABEL ON ROLE (https://github.com/citusdata/citus/pull/7304)
- [ ] SECURITY LABEL ON (objects other than roles)
- [x] VACUUM -- only propagated on tables

Schema-level statements:

ALTER SCHEMA .. OWNER TO ..

```sql
create schema my_schema;
create role non_super_user_role;
alter schema my_schema owner to non_super_user_role ;

SELECT pg_get_userbyid(nspowner) AS schema_owner
FROM pg_namespace
WHERE nspname = 'my_schema';
┌─────────────────────┐
│ schema_owner │
├─────────────────────┤
│ non_super_user_role │
└─────────────────────┘

select result from run_command_on_workers ($$
SELECT pg_get_userbyid(nspowner) AS schema_owner
FROM pg_namespace
WHERE nspname = 'my_schema'
$$);
┌─────────────┐
│ result │
├─────────────┤
│ onurctirtir │
│ onurctirtir │
└─────────────┘
(2 rows)
```

Table-level statements:
- [x] ALTER TABLE that changes multiple columns
- [x] ALTER TABLE that creates constraints without names https://github.com/citusdata/citus/issues/4776
- [x] ALTER TABLE that sets default to a function or sequence https://github.com/citusdata/citus/issues/4721
- [x] ALTER TABLE .. ADD CONSTRAINT .. UNIQUE USING INDEX .. https://github.com/citusdata/citus/issues/4774
- [ ] ALTER TABLE .. DROP EXPRESSION https://github.com/citusdata/citus/issues/4070
- [x] ALTER/CREATE/DROP TRIGGER
- [ ] ALTER TABLE .. ALTER COLUMN on a distribution column
- [ ] Foreign keys between 2 distributed tables without a distribution column
- [ ] Foreign key from a reference table to a distributed table
- [x] Identity columns https://github.com/citusdata/citus/issues/4660

Session-level statements:
- [ ] SET
- [ ] SET CONSTRAINTS
- [ ] SET ROLE
- [ ] SET SESSION AUTHORIZATION
- [x] SET TRANSACTION https://github.com/citusdata/citus/pull/4945

System-level statements (may be outside of Citus scope):
- [x] ALTER/CREATE/DROP DATABASE
https://github.com/citusdata/citus/pull/7240
https://github.com/citusdata/citus/pull/7181
https://github.com/citusdata/citus/pull/7172
https://github.com/citusdata/citus/pull/7253
- [ ] ALTER/CREATE/DROP TABLESPACE
- [ ] ALTER LARGE OBJECT
- [ ] ALTER SYSTEM
- [ ] CHECKPOINT
- [x] GRANT/REVOKE .. ON DATATABASE
- [x] REASSIGN .. OWNED (https://github.com/citusdata/citus/pull/7319)
- [x] DROP OWNED BY
- [x] GRANT one_user TO another_user;
- [ ] GRANT/REVOKE ON PARAMETER ...

Statements that are typically only used by extensions (which are already propagated):
- [ ] ALTER/CREATE/DROP ACCESS METHOD
- [ ] ALTER/CREATE/DROP CONVERSION
- [ ] ALTER/CREATE/DROP EVENT TRIGGER
- [ ] ALTER/CREATE/DROP FOREIGN DATA WRAPPER
- [ ] ALTER/CREATE/DROP LANGUAGE
- [ ] ALTER/CREATE/DROP OPERATOR
- [ ] ALTER/CREATE/DROP OPERATOR CLASS
- [ ] ALTER/CREATE/DROP OPERATOR FAMILY
- [x] ALTER/CREATE/DROP TEXT SEARCH CONFIGURATION
- [x] ALTER/CREATE/DROP TEXT SEARCH DICTIONARY
- [ ] ALTER/CREATE/DROP TEXT SEARCH PARSER
- [ ] ALTER/CREATE/DROP TEXT SEARCH TEMPLATE
- [ ] CREATE/DROP TRANSFORM
- [ ] CREATE/DROP CAST

Statements work as intended, but could have a distributed implementation:
- [ ] ALTER/CREATE/DROP FOREIGN TABLE / FOREIGN DATA WRAPPER / SERVER / USER MAPPING
- [ ] ALTER/CREATE/DROP MATERIALIZED VIEW
- [x] ALTER/CREATE/DROP PUBLICATION
- [ ] ALTER/CREATE/DROP RULE
- [ ] ALTER/CREATE/DROP SUBSCRIPTION
- [ ] ALTER/CREATE/DROP TABLE -- could automatically have Citus manage new tables
- [x] ALTER/CREATE/DROP VIEW

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.