mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
Add DOMAIN check constraints.
Rod Taylor
This commit is contained in:
@ -15,7 +15,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.217 2002/11/11 22:19:22 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.218 2002/11/15 02:50:06 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -1056,11 +1056,35 @@ _copyConstraintTest(ConstraintTest *from)
|
||||
newnode->testtype = from->testtype;
|
||||
if (from->name)
|
||||
newnode->name = pstrdup(from->name);
|
||||
if (from->domname)
|
||||
newnode->domname = pstrdup(from->domname);
|
||||
Node_Copy(from, newnode, check_expr);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static ConstraintTestValue *
|
||||
_copyConstraintTestValue(ConstraintTestValue *from)
|
||||
{
|
||||
ConstraintTestValue *newnode = makeNode(ConstraintTestValue);
|
||||
|
||||
/*
|
||||
* copy remainder of node
|
||||
*/
|
||||
newnode->typeId = from->typeId;
|
||||
newnode->typeMod = from->typeMod;
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static DomainConstraintValue *
|
||||
_copyDomainConstraintValue(DomainConstraintValue *from)
|
||||
{
|
||||
DomainConstraintValue *newnode = makeNode(DomainConstraintValue);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static ArrayRef *
|
||||
_copyArrayRef(ArrayRef *from)
|
||||
{
|
||||
@ -3252,6 +3276,9 @@ copyObject(void *from)
|
||||
case T_ConstraintTest:
|
||||
retval = _copyConstraintTest(from);
|
||||
break;
|
||||
case T_ConstraintTestValue:
|
||||
retval = _copyConstraintTestValue(from);
|
||||
break;
|
||||
case T_FkConstraint:
|
||||
retval = _copyFkConstraint(from);
|
||||
break;
|
||||
@ -3264,6 +3291,9 @@ copyObject(void *from)
|
||||
case T_InsertDefault:
|
||||
retval = _copyInsertDefault(from);
|
||||
break;
|
||||
case T_DomainConstraintValue:
|
||||
retval = _copyDomainConstraintValue(from);
|
||||
break;
|
||||
|
||||
default:
|
||||
elog(ERROR, "copyObject: don't know how to copy node type %d",
|
||||
|
Reference in New Issue
Block a user