mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Preliminary code review for domain CHECK constraints patch: add documentation,
make VALUE a non-reserved word again, use less invasive method of passing ConstraintTestValue into transformExpr, fix problems with nested constraint testing, do correct thing with NULL result from a constraint expression, remove memory leak. Domain checks still need much more work if we are going to allow ALTER DOMAIN, however.
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.230 2002/12/12 15:49:28 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.231 2002/12/12 20:35:12 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1297,14 +1297,6 @@ _copyTypeName(TypeName *from)
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static DomainConstraintValue *
|
||||
_copyDomainConstraintValue(DomainConstraintValue *from)
|
||||
{
|
||||
DomainConstraintValue *newnode = makeNode(DomainConstraintValue);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static SortGroupBy *
|
||||
_copySortGroupBy(SortGroupBy *from)
|
||||
{
|
||||
@@ -2763,9 +2755,6 @@ copyObject(void *from)
|
||||
case T_TypeCast:
|
||||
retval = _copyTypeCast(from);
|
||||
break;
|
||||
case T_DomainConstraintValue:
|
||||
retval = _copyDomainConstraintValue(from);
|
||||
break;
|
||||
case T_SortGroupBy:
|
||||
retval = _copySortGroupBy(from);
|
||||
break;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.175 2002/12/12 15:49:28 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.176 2002/12/12 20:35:12 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -648,12 +648,6 @@ _equalInsertDefault(InsertDefault *a, InsertDefault *b)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalDomainConstraintValue(DomainConstraintValue *a, DomainConstraintValue *b)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalClosePortalStmt(ClosePortalStmt *a, ClosePortalStmt *b)
|
||||
{
|
||||
@@ -1931,9 +1925,6 @@ equal(void *a, void *b)
|
||||
case T_InsertDefault:
|
||||
retval = _equalInsertDefault(a, b);
|
||||
break;
|
||||
case T_DomainConstraintValue:
|
||||
retval = _equalDomainConstraintValue(a, b);
|
||||
break;
|
||||
|
||||
default:
|
||||
elog(WARNING, "equal: don't know whether nodes of type %d are equal",
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.187 2002/12/12 15:49:28 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.188 2002/12/12 20:35:12 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Every node type that can appear in stored rules' parsetrees *must*
|
||||
@@ -1299,12 +1299,6 @@ _outExprFieldSelect(StringInfo str, ExprFieldSelect *node)
|
||||
WRITE_NODE_FIELD(indirection);
|
||||
}
|
||||
|
||||
static void
|
||||
_outDomainConstraintValue(StringInfo str, DomainConstraintValue *node)
|
||||
{
|
||||
WRITE_NODE_TYPE("DOMAINCONSTRAINTVALUE");
|
||||
}
|
||||
|
||||
static void
|
||||
_outConstraint(StringInfo str, Constraint *node)
|
||||
{
|
||||
@@ -1637,9 +1631,6 @@ _outNode(StringInfo str, void *obj)
|
||||
case T_ExprFieldSelect:
|
||||
_outExprFieldSelect(str, obj);
|
||||
break;
|
||||
case T_DomainConstraintValue:
|
||||
_outDomainConstraintValue(str, obj);
|
||||
break;
|
||||
case T_Constraint:
|
||||
_outConstraint(str, obj);
|
||||
break;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.141 2002/12/12 15:49:28 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.142 2002/12/12 20:35:12 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Path and Plan nodes do not have any readfuncs support, because we
|
||||
@@ -792,17 +792,6 @@ _readExprFieldSelect(void)
|
||||
READ_DONE();
|
||||
}
|
||||
|
||||
/*
|
||||
* _readDomainConstraintValue
|
||||
*/
|
||||
static DomainConstraintValue *
|
||||
_readDomainConstraintValue(void)
|
||||
{
|
||||
READ_LOCALS_NO_FIELDS(DomainConstraintValue);
|
||||
|
||||
READ_DONE();
|
||||
}
|
||||
|
||||
/*
|
||||
* _readRangeTblEntry
|
||||
*/
|
||||
@@ -935,8 +924,6 @@ parseNodeString(void)
|
||||
return_value = _readTypeName();
|
||||
else if (MATCH("EXPRFIELDSELECT", 15))
|
||||
return_value = _readExprFieldSelect();
|
||||
else if (MATCH("DOMAINCONSTRAINTVALUE", 21))
|
||||
return_value = _readDomainConstraintValue();
|
||||
else if (MATCH("RTE", 3))
|
||||
return_value = _readRangeTblEntry();
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user