Change Constraint structure name from ConstraintDef to Constraint.

Change reference to field inside to be compatible with new definition
 as a "node" structure rather than a specialty structure.
This commit is contained in:
Thomas G. Lockhart 1997-12-04 23:15:28 +00:00
parent 1ac4ae4993
commit 0569136e48
1 changed files with 9 additions and 11 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.21 1997/11/28 17:27:04 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.22 1997/12/04 23:15:28 thomas Exp $
*
*-------------------------------------------------------------------------
*/
@ -99,9 +99,9 @@ DefineRelation(CreateStmt *stmt)
foreach(entry, constraints)
{
ConstraintDef *cdef = (ConstraintDef *) lfirst(entry);
Constraint *cdef = (Constraint *) lfirst(entry);
if (cdef->type == CONSTR_CHECK)
if (cdef->contype == CONSTR_CHECK)
{
if (cdef->name != NULL)
{
@ -218,7 +218,7 @@ MergeAttributes(List *schema, List *supers, List **supconstr)
if (!strcmp(coldef->colname, restdef->colname))
{
elog(WARN, "attribute \"%s\" duplicated",
elog(WARN, "attribute '%s' duplicated",
coldef->colname);
}
}
@ -231,7 +231,7 @@ MergeAttributes(List *schema, List *supers, List **supconstr)
{
if (!strcmp(strVal(lfirst(entry)), strVal(lfirst(rest))))
{
elog(WARN, "relation \"%s\" duplicated",
elog(WARN, "relation '%s' duplicated",
strVal(lfirst(entry)));
}
}
@ -253,13 +253,11 @@ MergeAttributes(List *schema, List *supers, List **supconstr)
if (relation == NULL)
{
elog(WARN,
"MergeAttr: Can't inherit from non-existent superclass '%s'",
name);
"MergeAttr: Can't inherit from non-existent superclass '%s'", name);
}
if (relation->rd_rel->relkind == 'S')
{
elog(WARN, "MergeAttr: Can't inherit from sequence superclass '%s'",
name);
elog(WARN, "MergeAttr: Can't inherit from sequence superclass '%s'", name);
}
tupleDesc = RelationGetTupleDescriptor(relation);
constr = tupleDesc->constr;
@ -335,9 +333,9 @@ MergeAttributes(List *schema, List *supers, List **supconstr)
for (i = 0; i < constr->num_check; i++)
{
ConstraintDef *cdef = (ConstraintDef *) palloc(sizeof(ConstraintDef));
Constraint *cdef = (Constraint *) makeNode(Constraint); /* palloc(sizeof(Constraint)); */
cdef->type = CONSTR_CHECK;
cdef->contype = CONSTR_CHECK;
if (check[i].ccname[0] == '$')
cdef->name = NULL;
else