summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-07-15 16:33:32 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-07-15 16:33:32 +0000
commit7bd631bfa4740c20625ae1f16856707baeda466d (patch)
treee851f618c76895be9e78fc8458315a34c9c938a5 /src/include
parent3c580b8d979a94ea0e41578c7ac1d4625d242853 (diff)
downloadpostgresql-7bd631bfa4740c20625ae1f16856707baeda466d.tar.gz
Use the dependency mechanism to manage column defaults. We need this
so that dependencies in default expressions (on operators, functions, etc) can be expressed properly.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/catversion.h4
-rw-r--r--src/include/catalog/heap.h5
-rw-r--r--src/include/catalog/indexing.h10
-rw-r--r--src/include/catalog/pg_attrdef.h6
4 files changed, 18 insertions, 7 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index 9d3acbe35f..5fd581b254 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -37,7 +37,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: catversion.h,v 1.139 2002/07/12 18:43:19 tgl Exp $
+ * $Id: catversion.h,v 1.140 2002/07/15 16:33:31 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 200207112
+#define CATALOG_VERSION_NO 200207141
#endif
diff --git a/src/include/catalog/heap.h b/src/include/catalog/heap.h
index 44c8e13bf6..3148fd3263 100644
--- a/src/include/catalog/heap.h
+++ b/src/include/catalog/heap.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: heap.h,v 1.53 2002/07/14 21:08:08 tgl Exp $
+ * $Id: heap.h,v 1.54 2002/07/15 16:33:31 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -63,6 +63,9 @@ extern int RemoveRelConstraints(Relation rel, const char *constrName,
extern void DeleteRelationTuple(Oid relid);
extern void DeleteAttributeTuples(Oid relid);
+extern void RemoveAttrDefault(Oid relid, AttrNumber attnum,
+ DropBehavior behavior, bool complain);
+extern void RemoveAttrDefaultById(Oid attrdefId);
extern Form_pg_attribute SystemAttributeDefinition(AttrNumber attno,
bool relhasoids);
diff --git a/src/include/catalog/indexing.h b/src/include/catalog/indexing.h
index d4ca744172..91e3593447 100644
--- a/src/include/catalog/indexing.h
+++ b/src/include/catalog/indexing.h
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: indexing.h,v 1.69 2002/07/12 18:43:19 tgl Exp $
+ * $Id: indexing.h,v 1.70 2002/07/15 16:33:31 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -25,10 +25,10 @@
#define Num_pg_amop_indices 2
#define Num_pg_amproc_indices 1
#define Num_pg_attr_indices 2
-#define Num_pg_attrdef_indices 1
+#define Num_pg_attrdef_indices 2
#define Num_pg_class_indices 2
#define Num_pg_constraint_indices 3
-#define Num_pg_conversion_indices 2
+#define Num_pg_conversion_indices 3
#define Num_pg_database_indices 2
#define Num_pg_depend_indices 2
#define Num_pg_description_indices 1
@@ -57,6 +57,7 @@
#define AmNameIndex "pg_am_name_index"
#define AmOidIndex "pg_am_oid_index"
#define AttrDefaultIndex "pg_attrdef_adrelid_adnum_index"
+#define AttrDefaultOidIndex "pg_attrdef_oid_index"
#define AttributeRelidNameIndex "pg_attribute_relid_attnam_index"
#define AttributeRelidNumIndex "pg_attribute_relid_attnum_index"
#define ClassNameNspIndex "pg_class_relname_nsp_index"
@@ -66,6 +67,7 @@
#define ConstraintRelidIndex "pg_constraint_conrelid_index"
#define ConversionDefaultIndex "pg_conversion_default_index"
#define ConversionNameNspIndex "pg_conversion_name_nsp_index"
+#define ConversionOidIndex "pg_conversion_oid_index"
#define DatabaseNameIndex "pg_database_datname_index"
#define DatabaseOidIndex "pg_database_oid_index"
#define DependDependerIndex "pg_depend_depender_index"
@@ -161,6 +163,7 @@ DECLARE_UNIQUE_INDEX(pg_amop_opc_opr_index on pg_amop using btree(amopclaid oid_
DECLARE_UNIQUE_INDEX(pg_amop_opc_strategy_index on pg_amop using btree(amopclaid oid_ops, amopstrategy int2_ops));
DECLARE_UNIQUE_INDEX(pg_amproc_opc_procnum_index on pg_amproc using btree(amopclaid oid_ops, amprocnum int2_ops));
DECLARE_UNIQUE_INDEX(pg_attrdef_adrelid_adnum_index on pg_attrdef using btree(adrelid oid_ops, adnum int2_ops));
+DECLARE_UNIQUE_INDEX(pg_attrdef_oid_index on pg_attrdef using btree(oid oid_ops));
DECLARE_UNIQUE_INDEX(pg_attribute_relid_attnam_index on pg_attribute using btree(attrelid oid_ops, attname name_ops));
DECLARE_UNIQUE_INDEX(pg_attribute_relid_attnum_index on pg_attribute using btree(attrelid oid_ops, attnum int2_ops));
DECLARE_UNIQUE_INDEX(pg_class_oid_index on pg_class using btree(oid oid_ops));
@@ -173,6 +176,7 @@ DECLARE_UNIQUE_INDEX(pg_constraint_oid_index on pg_constraint using btree(oid oi
/* This following index is not used for a cache and is not unique */
DECLARE_INDEX(pg_conversion_default_index on pg_conversion using btree(connamespace oid_ops, conforencoding int4_ops, contoencoding int4_ops));
DECLARE_UNIQUE_INDEX(pg_conversion_name_nsp_index on pg_conversion using btree(conname name_ops, connamespace oid_ops));
+DECLARE_UNIQUE_INDEX(pg_conversion_oid_index on pg_conversion using btree(oid oid_ops));
DECLARE_UNIQUE_INDEX(pg_database_datname_index on pg_database using btree(datname name_ops));
DECLARE_UNIQUE_INDEX(pg_database_oid_index on pg_database using btree(oid oid_ops));
/* This following index is not used for a cache and is not unique */
diff --git a/src/include/catalog/pg_attrdef.h b/src/include/catalog/pg_attrdef.h
index 7df4f324e0..3d39911d83 100644
--- a/src/include/catalog/pg_attrdef.h
+++ b/src/include/catalog/pg_attrdef.h
@@ -1,11 +1,15 @@
/*-------------------------------------------------------------------------
*
* pg_attrdef.h
+ * definition of the system "attribute defaults" relation (pg_attrdef)
+ * along with the relation's initial contents.
*
*
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
+ * $Id: pg_attrdef.h,v 1.13 2002/07/15 16:33:32 tgl Exp $
+ *
* NOTES
* the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
@@ -27,7 +31,7 @@
* typedef struct FormData_pg_attrdef
* ----------------
*/
-CATALOG(pg_attrdef) BKI_WITHOUT_OIDS
+CATALOG(pg_attrdef)
{
Oid adrelid;
int2 adnum;