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:
parent
1ac4ae4993
commit
0569136e48
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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)
|
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)
|
if (cdef->name != NULL)
|
||||||
{
|
{
|
||||||
@ -218,7 +218,7 @@ MergeAttributes(List *schema, List *supers, List **supconstr)
|
|||||||
|
|
||||||
if (!strcmp(coldef->colname, restdef->colname))
|
if (!strcmp(coldef->colname, restdef->colname))
|
||||||
{
|
{
|
||||||
elog(WARN, "attribute \"%s\" duplicated",
|
elog(WARN, "attribute '%s' duplicated",
|
||||||
coldef->colname);
|
coldef->colname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -231,7 +231,7 @@ MergeAttributes(List *schema, List *supers, List **supconstr)
|
|||||||
{
|
{
|
||||||
if (!strcmp(strVal(lfirst(entry)), strVal(lfirst(rest))))
|
if (!strcmp(strVal(lfirst(entry)), strVal(lfirst(rest))))
|
||||||
{
|
{
|
||||||
elog(WARN, "relation \"%s\" duplicated",
|
elog(WARN, "relation '%s' duplicated",
|
||||||
strVal(lfirst(entry)));
|
strVal(lfirst(entry)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -253,13 +253,11 @@ MergeAttributes(List *schema, List *supers, List **supconstr)
|
|||||||
if (relation == NULL)
|
if (relation == NULL)
|
||||||
{
|
{
|
||||||
elog(WARN,
|
elog(WARN,
|
||||||
"MergeAttr: Can't inherit from non-existent superclass '%s'",
|
"MergeAttr: Can't inherit from non-existent superclass '%s'", name);
|
||||||
name);
|
|
||||||
}
|
}
|
||||||
if (relation->rd_rel->relkind == 'S')
|
if (relation->rd_rel->relkind == 'S')
|
||||||
{
|
{
|
||||||
elog(WARN, "MergeAttr: Can't inherit from sequence superclass '%s'",
|
elog(WARN, "MergeAttr: Can't inherit from sequence superclass '%s'", name);
|
||||||
name);
|
|
||||||
}
|
}
|
||||||
tupleDesc = RelationGetTupleDescriptor(relation);
|
tupleDesc = RelationGetTupleDescriptor(relation);
|
||||||
constr = tupleDesc->constr;
|
constr = tupleDesc->constr;
|
||||||
@ -335,9 +333,9 @@ MergeAttributes(List *schema, List *supers, List **supconstr)
|
|||||||
|
|
||||||
for (i = 0; i < constr->num_check; i++)
|
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] == '$')
|
if (check[i].ccname[0] == '$')
|
||||||
cdef->name = NULL;
|
cdef->name = NULL;
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user