mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +03:00
Remove obsolete pg_constraint.consrc column
This has been deprecated and effectively unused for a long time. Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
This commit is contained in:
@@ -2315,7 +2315,6 @@ StoreRelCheck(Relation rel, const char *ccname, Node *expr,
|
||||
bool is_no_inherit, bool is_internal)
|
||||
{
|
||||
char *ccbin;
|
||||
char *ccsrc;
|
||||
List *varList;
|
||||
int keycount;
|
||||
int16 *attNos;
|
||||
@@ -2326,14 +2325,6 @@ StoreRelCheck(Relation rel, const char *ccname, Node *expr,
|
||||
*/
|
||||
ccbin = nodeToString(expr);
|
||||
|
||||
/*
|
||||
* Also deparse it to form the mostly-obsolete consrc field.
|
||||
*/
|
||||
ccsrc = deparse_expression(expr,
|
||||
deparse_context_for(RelationGetRelationName(rel),
|
||||
RelationGetRelid(rel)),
|
||||
false, false);
|
||||
|
||||
/*
|
||||
* Find columns of rel that are used in expr
|
||||
*
|
||||
@@ -2406,14 +2397,12 @@ StoreRelCheck(Relation rel, const char *ccname, Node *expr,
|
||||
NULL, /* not an exclusion constraint */
|
||||
expr, /* Tree form of check constraint */
|
||||
ccbin, /* Binary form of check constraint */
|
||||
ccsrc, /* Source form of check constraint */
|
||||
is_local, /* conislocal */
|
||||
inhcount, /* coninhcount */
|
||||
is_no_inherit, /* connoinherit */
|
||||
is_internal); /* internally constructed? */
|
||||
|
||||
pfree(ccbin);
|
||||
pfree(ccsrc);
|
||||
|
||||
return constrOid;
|
||||
}
|
||||
|
||||
@@ -1336,7 +1336,6 @@ index_constraint_create(Relation heapRelation,
|
||||
indexInfo->ii_ExclusionOps,
|
||||
NULL, /* no check constraint */
|
||||
NULL,
|
||||
NULL,
|
||||
islocal,
|
||||
inhcount,
|
||||
noinherit,
|
||||
|
||||
@@ -78,7 +78,6 @@ CreateConstraintEntry(const char *constraintName,
|
||||
const Oid *exclOp,
|
||||
Node *conExpr,
|
||||
const char *conBin,
|
||||
const char *conSrc,
|
||||
bool conIsLocal,
|
||||
int conInhCount,
|
||||
bool conNoInherit,
|
||||
@@ -218,22 +217,11 @@ CreateConstraintEntry(const char *constraintName,
|
||||
else
|
||||
nulls[Anum_pg_constraint_conexclop - 1] = true;
|
||||
|
||||
/*
|
||||
* initialize the binary form of the check constraint.
|
||||
*/
|
||||
if (conBin)
|
||||
values[Anum_pg_constraint_conbin - 1] = CStringGetTextDatum(conBin);
|
||||
else
|
||||
nulls[Anum_pg_constraint_conbin - 1] = true;
|
||||
|
||||
/*
|
||||
* initialize the text form of the check constraint
|
||||
*/
|
||||
if (conSrc)
|
||||
values[Anum_pg_constraint_consrc - 1] = CStringGetTextDatum(conSrc);
|
||||
else
|
||||
nulls[Anum_pg_constraint_consrc - 1] = true;
|
||||
|
||||
tup = heap_form_tuple(RelationGetDescr(conDesc), values, nulls);
|
||||
|
||||
conOid = CatalogTupleInsert(conDesc, tup);
|
||||
@@ -703,7 +691,6 @@ clone_fk_constraints(Relation pg_constraint, Relation parentRel,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
false,
|
||||
1, false, true);
|
||||
subclone = lappend_oid(subclone, constrOid);
|
||||
|
||||
@@ -7704,7 +7704,6 @@ ATAddForeignKeyConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel,
|
||||
NULL, /* no exclusion constraint */
|
||||
NULL, /* no check constraint */
|
||||
NULL,
|
||||
NULL,
|
||||
true, /* islocal */
|
||||
0, /* inhcount */
|
||||
true, /* isnoinherit */
|
||||
|
||||
@@ -752,7 +752,6 @@ CreateTrigger(CreateTrigStmt *stmt, const char *queryString,
|
||||
NULL, /* no exclusion */
|
||||
NULL, /* no check constraint */
|
||||
NULL,
|
||||
NULL,
|
||||
true, /* islocal */
|
||||
0, /* inhcount */
|
||||
true, /* isnoinherit */
|
||||
|
||||
@@ -3042,7 +3042,6 @@ domainAddConstraint(Oid domainOid, Oid domainNamespace, Oid baseTypeOid,
|
||||
const char *domainName, ObjectAddress *constrAddr)
|
||||
{
|
||||
Node *expr;
|
||||
char *ccsrc;
|
||||
char *ccbin;
|
||||
ParseState *pstate;
|
||||
CoerceToDomainValue *domVal;
|
||||
@@ -3116,12 +3115,6 @@ domainAddConstraint(Oid domainOid, Oid domainNamespace, Oid baseTypeOid,
|
||||
*/
|
||||
ccbin = nodeToString(expr);
|
||||
|
||||
/*
|
||||
* Deparse it to produce text for consrc.
|
||||
*/
|
||||
ccsrc = deparse_expression(expr,
|
||||
NIL, false, false);
|
||||
|
||||
/*
|
||||
* Store the constraint in pg_constraint
|
||||
*/
|
||||
@@ -3151,7 +3144,6 @@ domainAddConstraint(Oid domainOid, Oid domainNamespace, Oid baseTypeOid,
|
||||
NULL, /* not an exclusion constraint */
|
||||
expr, /* Tree form of check constraint */
|
||||
ccbin, /* Binary form of check constraint */
|
||||
ccsrc, /* Source form of check constraint */
|
||||
true, /* is local */
|
||||
0, /* inhcount */
|
||||
false, /* connoinherit */
|
||||
|
||||
Reference in New Issue
Block a user