Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0569136

Browse files
author
Thomas G. Lockhart
committed
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.
1 parent 1ac4ae4 commit 0569136

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/backend/commands/creatinh.c

+9-11
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.21 1997/11/28 17:27:04 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.22 1997/12/04 23:15:28 thomas Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -99,9 +99,9 @@ DefineRelation(CreateStmt *stmt)
9999

100100
foreach(entry, constraints)
101101
{
102-
ConstraintDef *cdef = (ConstraintDef *) lfirst(entry);
102+
Constraint *cdef = (Constraint *) lfirst(entry);
103103

104-
if (cdef->type == CONSTR_CHECK)
104+
if (cdef->contype == CONSTR_CHECK)
105105
{
106106
if (cdef->name != NULL)
107107
{
@@ -218,7 +218,7 @@ MergeAttributes(List *schema, List *supers, List **supconstr)
218218

219219
if (!strcmp(coldef->colname, restdef->colname))
220220
{
221-
elog(WARN, "attribute \"%s\" duplicated",
221+
elog(WARN, "attribute '%s' duplicated",
222222
coldef->colname);
223223
}
224224
}
@@ -231,7 +231,7 @@ MergeAttributes(List *schema, List *supers, List **supconstr)
231231
{
232232
if (!strcmp(strVal(lfirst(entry)), strVal(lfirst(rest))))
233233
{
234-
elog(WARN, "relation \"%s\" duplicated",
234+
elog(WARN, "relation '%s' duplicated",
235235
strVal(lfirst(entry)));
236236
}
237237
}
@@ -253,13 +253,11 @@ MergeAttributes(List *schema, List *supers, List **supconstr)
253253
if (relation == NULL)
254254
{
255255
elog(WARN,
256-
"MergeAttr: Can't inherit from non-existent superclass '%s'",
257-
name);
256+
"MergeAttr: Can't inherit from non-existent superclass '%s'", name);
258257
}
259258
if (relation->rd_rel->relkind == 'S')
260259
{
261-
elog(WARN, "MergeAttr: Can't inherit from sequence superclass '%s'",
262-
name);
260+
elog(WARN, "MergeAttr: Can't inherit from sequence superclass '%s'", name);
263261
}
264262
tupleDesc = RelationGetTupleDescriptor(relation);
265263
constr = tupleDesc->constr;
@@ -335,9 +333,9 @@ MergeAttributes(List *schema, List *supers, List **supconstr)
335333

336334
for (i = 0; i < constr->num_check; i++)
337335
{
338-
ConstraintDef *cdef = (ConstraintDef *) palloc(sizeof(ConstraintDef));
336+
Constraint *cdef = (Constraint *) makeNode(Constraint); /* palloc(sizeof(Constraint)); */
339337

340-
cdef->type = CONSTR_CHECK;
338+
cdef->contype = CONSTR_CHECK;
341339
if (check[i].ccname[0] == '$')
342340
cdef->name = NULL;
343341
else

0 commit comments

Comments
 (0)