[-] completed [*] yet to do [?] does it need to be done? - Create Type - Create View * Create View (on precompile set deps in source) - Create Trigger - Create Table (Columns on Types) * Create Table / Column Defaults (on precompile set deps in source) ? Create Sequence (function deps -- currval, nextval, setval) - Create Rule (always cascade) - Create Operator - Create Language - Create Index - Create Function * Create Function (on precompile set additional deps in source) - Create Aggregate (on precompile set additional deps) - Drop Type - Drop View - Drop Trigger - Drop Table - Drop Sequence - Drop Rule - Drop Operator - Drop Language - Drop Index - Drop Function - Drop Aggregate - Alter Table / Primary Key - Alter Table / unique index * Alter Table / Default (Compiled default depends on functions / types within) - Alter Table / Add Column - Alter table / add column which creates toast table - Base type dependency on array type managed by pg_depend (always cascaded) - Table drop foreign key triggers as managed by pg_depend (always cascaded) - Toast tables depend on relation (always cascade) * Enable opt_behaviour for most items in gram.y pg_depend system relations: - pg_attribute.attypid -> pg_type ? pg_class.reltype -> pg_type (type depends on relation covered below) ? pg_class.relam -> pg_am - pg_class.reltoastrelid -> pg_class - pg_class.reltoastidxid -> pg_idxid - pg_proc.prolang -> pg_language - pg_proc.prorettype -> Return Type - pg_proc.proargtypes -> (Many input types -- assumption of max 4 oids in the oidvector) - pg_type.typinput -> pg_proc - pg_type.typoutput -> pg_proc - pg_type.typreceive -> pg_proc - pg_type.typsend -> pg_proc - pg_type.typrelid -> pg_class - pg_type.typelem -> pg_type - pg_trigger.tgfoid -> pg_function - pg_trigger.tgrelid -> pg_class - pg_trigger.tgconstrrelid -> pg_class (always cascade) - pg_rewrite.ev_class -> pg_class ? pg_opclass -> * (Can users add or modify these?) - pg_operator.oprleft -> pg_type - pg_operator.oprright -> pg_type - pg_operator.oprresult -> pg_type - pg_operator.oprcom -> pg_operator - pg_operator.oprnegate -> pg_operator - pg_operator.oprlsortop -> pg_operator - pg_operator.oprrsorttop -> pg_operator - pg_operator.oprcode -> pg_proc - pg_operator.oprrest -> pg_proc - pg_operator.oprjoin -> pg_proc - pg_aggregate.aggtransfn -> pg_proc - pg_aggregate.aggfinalfn -> pg_proc - pg_aggregate.aggbasetype -> pg_type - pg_aggregate.aggtranstype -> pg_type - pg_aggregate.aggfinaltype -> pg_type OTHER NOTES ----------- DROP TYPE should be restricted by DROP TYPE. Ie. DROP TYPE pg_class; CREATE TABLE tab (col1 int4 DEFAULT nextval('seq')); DROP FUNCTION nextval(text) CASCADE; Drop the column (col1) or set the default to NULL? Do objects depend on users (ownership)? ie. DROP USER CASCADE to dump everything they own when they're removed?