? src/backend/access/common/.deps ? src/backend/access/gist/.deps ? src/backend/access/hash/.deps ? src/backend/access/heap/.deps ? src/backend/access/index/.deps ? src/backend/access/nbtree/.deps ? src/backend/access/rtree/.deps ? src/backend/access/transam/.deps ? src/backend/bootstrap/.deps ? src/backend/catalog/.deps ? src/backend/catalog/pg_constraint.c ? src/backend/catalog/pg_depend.c ? src/backend/commands/.deps ? src/backend/executor/.deps ? src/backend/lib/.deps ? src/backend/libpq/.deps ? src/backend/main/.deps ? src/backend/nodes/.deps ? src/backend/optimizer/geqo/.deps ? src/backend/optimizer/path/.deps ? src/backend/optimizer/plan/.deps ? src/backend/optimizer/prep/.deps ? src/backend/optimizer/util/.deps ? src/backend/parser/.deps ? src/backend/port/.deps ? src/backend/postmaster/.deps ? src/backend/regex/.deps ? src/backend/rewrite/.deps ? src/backend/storage/buffer/.deps ? src/backend/storage/file/.deps ? src/backend/storage/freespace/.deps ? src/backend/storage/ipc/.deps ? src/backend/storage/large_object/.deps ? src/backend/storage/lmgr/.deps ? src/backend/storage/page/.deps ? src/backend/storage/smgr/.deps ? src/backend/tcop/.deps ? src/backend/utils/.deps ? src/backend/utils/adt/.deps ? src/backend/utils/cache/.deps ? src/backend/utils/error/.deps ? src/backend/utils/fmgr/.deps ? src/backend/utils/hash/.deps ? src/backend/utils/init/.deps ? src/backend/utils/mb/.deps ? src/backend/utils/misc/.deps ? src/backend/utils/mmgr/.deps ? src/backend/utils/sort/.deps ? src/backend/utils/time/.deps ? src/bin/pg_dump/.deps ? src/bin/pg_encoding/.deps ? src/bin/pg_id/.deps ? src/bin/pg_passwd/pg_passwd ? src/bin/psql/.deps ? src/include/catalog/pg_constraint.h ? src/include/catalog/pg_depend.h ? src/interfaces/ecpg/lib/.deps ? src/interfaces/ecpg/preproc/.deps ? src/interfaces/libpgeasy/.deps ? src/interfaces/libpq/.deps ? src/pl/plpgsql/src/.deps ? src/test/regress/expected/drop.out ? src/test/regress/sql/.alter_table.sql.swo ? src/test/regress/sql/.alter_table.sql.swp Index: doc/src/sgml/catalogs.sgml =================================================================== RCS file: /projects/cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v retrieving revision 2.43 diff -c -r2.43 catalogs.sgml *** doc/src/sgml/catalogs.sgml 2002/04/21 00:26:42 2.43 --- doc/src/sgml/catalogs.sgml 2002/06/15 16:37:46 *************** *** 72,82 **** --- 72,92 ---- + pg_constraint + check constraints, unique / primary key constraints, foreign key constraints + + + pg_database databases within this database cluster + pg_depend + dependencies between database objects + + + pg_description descriptions or comments on database objects *************** *** 132,142 **** - pg_relcheck - check constraints - - - pg_rewrite query rewriter rules --- 142,147 ---- *************** *** 680,686 **** Number of check constraints on the table; see ! pg_relcheck catalog --- 685,691 ---- Number of check constraints on the table; see ! pg_constraint catalog *************** *** 764,770 **** --- 769,908 ---- + + pg_constraint + + + This system catalog stores CHECK, PRIMARY KEY, UNIQUE, and FOREIGN KEY + constraints on tables. (Column + constraints are not treated specially. Every column constraint is + equivalent to some table constraint.) See under CREATE + TABLE for more information. + + NOT NULL Constraints are handled by the pg_attribute table. + + + + + pg_constraint Columns + + + + + Name + Type + References + Description + + + + + + conrelid + oid + pg_class.oid + The table this constraint is on + + + + conname + name + + Constraint name + + + + contype + char + + + 'u' = unique constraint, 'p' = primary key, 'f' = foreign key constraint, + 'c' = check constraint + + + + + condeferrable + boolean + + Is the constraint is deferrable? + + + + condeferred + boolean + + Is the constraint deferred by default? + + + + conkey + smallint[] + pg_attribute.attnum + List of columns to which the constraint is applied + + + + confrelid + oid + pg_class.oid + The table to which the foreign key refers to + + + + confkey + smallint[] + pg_attribute.attnum + List of columns which the foreign key constraint refers to + + + + confupdtype + char + + Foreign key update type + + + + confdeltype + char + + Foreign key deletion type + + + confmatchtype + oid + pg_class.oid + Foreign key match type. + + + + conbin + text + + An internal representation of the check constraint expression + + + + consrc + text + + A human-readable representation of the check constraint expression + + + +
+ + + + pg_class.relchecks + needs to match up with the entries in this table. + + + +
+ pg_database *************** *** 903,908 **** --- 1041,1133 ---- + + pg_depend + + + The pg_depend table stores the dependency tree between database + objects which enables RESTRICT and CASCADE on DROP statements to + function properly. + + + + pg_depend Columns + + + + + Name + Type + References + Description + + + + + + classid + oid + pg_class.oid + The oid of the system catalog this depender is in. + + + + objid + oid + any oid attribute + The oid of the object this depender pertains to + + + + objsubid + integer + + For a dependency on a table attribute, this is the attribute's + column number (the objid and classid refer to the table itself). + For all other object types, this field is presently zero. + + + + + depclassid + oid + pg_class.oid + The oid of the system catalog this dependee is in. + + + + depobjid + oid + any oid attribute + The oid of the object this dependee pertains to + + + + depobjsubid + integer + + For a dependee of a table attribute, this is the attribute's + column number (the objid and classid refer to the table itself). + For all other object types, this field is presently zero. + + + + + alwayscascade + boolean + + For implicit dependencies which should ignore the RESTRICT keyword + and be cascaded to anyway. A table to its complex type, or a primary key + constraint to the index which enforces the uniqueness portion + + + + +
+ +
+ + pg_description *************** *** 1853,1924 **** - - - - pg_relcheck - - - This system catalog stores CHECK constraints on tables. (Column - constraints are not treated specially. Every column constraint is - equivalent to some table constraint.) See under CREATE - TABLE for more information. - - - - pg_relcheck Columns - - - - - Name - Type - References - Description - - - - - - rcrelid - oid - pg_class.oid - The table this check constraint is on - - - - rcname - name - - Constraint name - - - - rcbin - text - - An internal representation of the constraint expression - - - - rcsrc - text - - A human-readable representation of the constraint expression - - - -
- - - - pg_class.relchecks - needs to match up with the entries in this table. - - - -
- pg_rewrite --- 2078,2083 ---- Index: doc/src/sgml/ref/comment.sgml =================================================================== RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ref/comment.sgml,v retrieving revision 1.19 diff -c -r1.19 comment.sgml *** doc/src/sgml/ref/comment.sgml 2002/05/13 17:45:30 1.19 --- doc/src/sgml/ref/comment.sgml 2002/06/15 16:37:46 *************** *** 26,31 **** --- 26,32 ---- TABLE object_name | COLUMN table_name.column_name | AGGREGATE agg_name (agg_type) | + CONSTRAINT constraint_name ON table_name | DATABASE object_name | DOMAIN object_name | FUNCTION func_name (arg1_type, arg2_type, ...) | Index: doc/src/sgml/ref/drop_aggregate.sgml =================================================================== RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ref/drop_aggregate.sgml,v retrieving revision 1.18 diff -c -r1.18 drop_aggregate.sgml *** doc/src/sgml/ref/drop_aggregate.sgml 2002/05/18 15:44:47 1.18 --- doc/src/sgml/ref/drop_aggregate.sgml 2002/06/15 16:37:46 *************** *** 21,27 **** 1999-07-20 ! DROP AGGREGATE name ( type ) --- 21,27 ---- 1999-07-20 ! DROP AGGREGATE name ( type ) [ CASCADE | RESTRICT ] *************** *** 51,56 **** --- 51,76 ---- further information about data types.) This should become a cross-reference rather than a hard-coded chapter number + + + + + + + RESTRICT + + + Ensures that only an aggregate with no dependent database objects + can be destroyed. + + + + + CASCADE + + + Any referencing database objects + will also be dropped. Index: doc/src/sgml/ref/drop_function.sgml =================================================================== RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ref/drop_function.sgml,v retrieving revision 1.20 diff -c -r1.20 drop_function.sgml *** doc/src/sgml/ref/drop_function.sgml 2002/05/18 15:44:47 1.20 --- doc/src/sgml/ref/drop_function.sgml 2002/06/15 16:37:46 *************** *** 21,27 **** 1999-07-20 ! DROP FUNCTION name ( [ type [, ...] ] ) --- 21,27 ---- 1999-07-20 ! DROP FUNCTION name ( [ type [, ...] ] ) [ CASCADE | RESTRICT ] *************** *** 46,51 **** --- 46,71 ---- The type of a parameter of the function. + + + + + + + RESTRICT + + + Ensures that only a function with no dependent types or operators + can be destroyed. + + + + + CASCADE + + + Any referencing types or operators + will also be dropped. Index: doc/src/sgml/ref/drop_index.sgml =================================================================== RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ref/drop_index.sgml,v retrieving revision 1.15 diff -c -r1.15 drop_index.sgml *** doc/src/sgml/ref/drop_index.sgml 2002/05/18 15:44:47 1.15 --- doc/src/sgml/ref/drop_index.sgml 2002/06/15 16:37:46 *************** *** 21,27 **** 1999-07-20 ! DROP INDEX index_name [, ...] --- 21,27 ---- 1999-07-20 ! DROP INDEX index_name [, ...] [ CASCADE | RESTRICT ] Index: doc/src/sgml/ref/drop_language.sgml =================================================================== RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ref/drop_language.sgml,v retrieving revision 1.14 diff -c -r1.14 drop_language.sgml *** doc/src/sgml/ref/drop_language.sgml 2002/05/18 15:44:47 1.14 --- doc/src/sgml/ref/drop_language.sgml 2002/06/15 16:37:46 *************** *** 21,27 **** 1999-07-20 ! DROP [ PROCEDURAL ] LANGUAGE name --- 21,27 ---- 1999-07-20 ! DROP [ PROCEDURAL ] LANGUAGE name [ CASCADE | RESTRICT ] *************** *** 44,49 **** --- 44,70 ---- + + + RESTRICT + + + Ensures that only a language with no dependent functions + can be destroyed. + + + + + CASCADE + + + Any referencing functions + will also be dropped. + + + + + Index: doc/src/sgml/ref/drop_operator.sgml =================================================================== RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ref/drop_operator.sgml,v retrieving revision 1.16 diff -c -r1.16 drop_operator.sgml *** doc/src/sgml/ref/drop_operator.sgml 2002/05/18 15:44:47 1.16 --- doc/src/sgml/ref/drop_operator.sgml 2002/06/15 16:37:47 *************** *** 22,28 **** 1999-07-20 ! DROP OPERATOR id ( lefttype | NONE , righttype | NONE ) --- 22,28 ---- 1999-07-20 ! DROP OPERATOR id ( lefttype | NONE , righttype | NONE ) [ CASCADE | RESTRICT ] Index: doc/src/sgml/ref/drop_rule.sgml =================================================================== RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ref/drop_rule.sgml,v retrieving revision 1.15 diff -c -r1.15 drop_rule.sgml *** doc/src/sgml/ref/drop_rule.sgml 2002/05/18 15:44:47 1.15 --- doc/src/sgml/ref/drop_rule.sgml 2002/06/15 16:37:51 *************** *** 21,27 **** 1998-09-22 ! DROP RULE name ON relation --- 21,27 ---- 1998-09-22 ! DROP RULE name ON relation [ CASCADE | RESTRICT ] *************** *** 51,56 **** --- 51,77 ---- + + + RESTRICT + + + Ensures that only a rule with no dependent database objects + can be destroyed. + + + + + CASCADE + + + Any referencing database objects + will also be dropped. + + + + + Index: doc/src/sgml/ref/drop_sequence.sgml =================================================================== RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ref/drop_sequence.sgml,v retrieving revision 1.14 diff -c -r1.14 drop_sequence.sgml *** doc/src/sgml/ref/drop_sequence.sgml 2002/05/18 15:44:47 1.14 --- doc/src/sgml/ref/drop_sequence.sgml 2002/06/15 16:37:51 *************** *** 21,27 **** 1999-07-20 ! DROP SEQUENCE name [, ...] --- 21,28 ---- 1999-07-20 ! DROP SEQUENCE name [, ...] [ CASCADE | RESTRICT ] ! *************** *** 76,81 **** --- 77,102 ---- + + + RESTRICT + + + Ensures that only a sequence dependent tables can be destroyed. + + + + + CASCADE + + + Any referencing tables + will also be dropped. + + + + + Index: doc/src/sgml/ref/drop_table.sgml =================================================================== RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ref/drop_table.sgml,v retrieving revision 1.15 diff -c -r1.15 drop_table.sgml *** doc/src/sgml/ref/drop_table.sgml 2002/05/18 15:44:47 1.15 --- doc/src/sgml/ref/drop_table.sgml 2002/06/15 16:37:51 *************** *** 21,27 **** 1999-07-20 ! DROP TABLE name [, ...] --- 21,28 ---- 1999-07-20 ! DROP TABLE name [, ...] [ CASCADE | RESTRICT ] ! *************** *** 42,47 **** --- 43,73 ---- + + + RESTRICT + + + Ensures that only a table with no dependent views or + integrity constraints can be destroyed. + + + + + CASCADE + + + Any referencing views or integrity constraints + will also be dropped. + + + + + + + + + *************** *** 135,182 **** Compatibility - - - 1998-09-22 - - - SQL92 - - - SQL92 specifies some additional capabilities for DROP TABLE: - - - DROP TABLE table { RESTRICT | CASCADE } - - - - RESTRICT - - - Ensures that only a table with no dependent views or - integrity constraints can be destroyed. - - - - - CASCADE - - - Any referencing views or integrity constraints - will also be dropped. - - - - - - - At present, to remove a referencing view you must drop - it explicitly. - - - - -