summaryrefslogtreecommitdiff
path: root/src/include/catalog
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2023-04-12 19:29:21 +0200
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2023-04-12 19:29:21 +0200
commit9ce04b50e120275afbc03ca0b80839dde3da8308 (patch)
treec9b815953349fc5bf689799108a2966fec755bf7 /src/include/catalog
parent8e82db97b0a474008d8212a63f34e449a8c50bcd (diff)
Revert "Catalog NOT NULL constraints" and fallout
This reverts commit e056c557aef4 and minor later fixes thereof. There's a few problems in this new feature -- most notably regarding pg_upgrade behavior, but others as well. This new feature is not in any way critical on its own, so instead of scrambling to fix it we revert it and try again in early 17 with these issues in mind. Discussion: https://postgr.es/m/3801207.1681057430@sss.pgh.pa.us
Diffstat (limited to 'src/include/catalog')
-rw-r--r--src/include/catalog/catversion.h2
-rw-r--r--src/include/catalog/heap.h7
-rw-r--r--src/include/catalog/pg_constraint.h11
3 files changed, 6 insertions, 14 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index 54f3ddcd97e..f152a2e82b6 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -57,6 +57,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 202304075
+#define CATALOG_VERSION_NO 202304111
#endif
diff --git a/src/include/catalog/heap.h b/src/include/catalog/heap.h
index 1683fdcb20a..d01ab504b6f 100644
--- a/src/include/catalog/heap.h
+++ b/src/include/catalog/heap.h
@@ -34,10 +34,10 @@ typedef struct RawColumnDefault
typedef struct CookedConstraint
{
- ConstrType contype; /* CONSTR_DEFAULT, CONSTR_CHECK, CONSTR_NOTNULL */
+ ConstrType contype; /* CONSTR_DEFAULT or CONSTR_CHECK */
Oid conoid; /* constr OID if created, otherwise Invalid */
char *name; /* name, or NULL if none */
- AttrNumber attnum; /* which attr (only for NOTNULL, DEFAULT) */
+ AttrNumber attnum; /* which attr (only for DEFAULT) */
Node *expr; /* transformed default or check expr */
bool skip_validation; /* skip validation? (only for CHECK) */
bool is_local; /* constraint has local (non-inherited) def */
@@ -113,9 +113,6 @@ extern List *AddRelationNewConstraints(Relation rel,
bool is_local,
bool is_internal,
const char *queryString);
-extern List *AddRelationNotNullConstraints(Relation rel,
- List *constraints,
- List *additional_notnulls);
extern void RelationClearMissing(Relation rel);
extern void SetAttrMissing(Oid relid, char *attname, char *value);
diff --git a/src/include/catalog/pg_constraint.h b/src/include/catalog/pg_constraint.h
index 13573a3cf1a..16bf5f5576e 100644
--- a/src/include/catalog/pg_constraint.h
+++ b/src/include/catalog/pg_constraint.h
@@ -181,7 +181,6 @@ DECLARE_ARRAY_FOREIGN_KEY((confrelid, confkey), pg_attribute, (attrelid, attnum)
/* Valid values for contype */
#define CONSTRAINT_CHECK 'c'
#define CONSTRAINT_FOREIGN 'f'
-#define CONSTRAINT_NOTNULL 'n'
#define CONSTRAINT_PRIMARY 'p'
#define CONSTRAINT_UNIQUE 'u'
#define CONSTRAINT_TRIGGER 't'
@@ -238,6 +237,9 @@ extern Oid CreateConstraintEntry(const char *constraintName,
bool conNoInherit,
bool is_internal);
+extern void RemoveConstraintById(Oid conId);
+extern void RenameConstraintById(Oid conId, const char *newname);
+
extern bool ConstraintNameIsUsed(ConstraintCategory conCat, Oid objId,
const char *conname);
extern bool ConstraintNameExists(const char *conname, Oid namespaceid);
@@ -245,13 +247,6 @@ extern char *ChooseConstraintName(const char *name1, const char *name2,
const char *label, Oid namespaceid,
List *others);
-extern HeapTuple findNotNullConstraintAttnum(Relation rel, AttrNumber attnum);
-extern HeapTuple findNotNullConstraint(Relation rel, const char *colname);
-extern AttrNumber extractNotNullColumn(HeapTuple constrTup);
-
-extern void RemoveConstraintById(Oid conId);
-extern void RenameConstraintById(Oid conId, const char *newname);
-
extern void AlterConstraintNamespaces(Oid ownerId, Oid oldNspId,
Oid newNspId, bool isType, ObjectAddresses *objsMoved);
extern void ConstraintSetParentConstraint(Oid childConstrId,