mirror of
https://github.com/postgres/postgres.git
synced 2025-11-18 02:02:55 +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:
@@ -10,7 +10,7 @@
|
||||
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: primnodes.h,v 1.72 2002/12/12 15:49:40 tgl Exp $
|
||||
* $Id: primnodes.h,v 1.73 2002/12/12 20:35:16 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -599,15 +599,19 @@ typedef struct ConstraintTest
|
||||
} ConstraintTest;
|
||||
|
||||
/*
|
||||
* Placeholder node for the value to be processed by a domains
|
||||
* check constraint. This is effectively like a Param; could we use
|
||||
* a Param node instead?
|
||||
* Placeholder node for the value to be processed by a domain's check
|
||||
* constraint. This is effectively like a Param, but can be implemented more
|
||||
* simply since we need only one replacement value at a time.
|
||||
*
|
||||
* Note: the typeId/typeMod will be set from the domain's base type, not
|
||||
* the domain itself. This is because we shouldn't consider the value to
|
||||
* be a member of the domain if we haven't yet checked its constraints.
|
||||
*/
|
||||
typedef struct ConstraintTestValue
|
||||
{
|
||||
Expr xpr;
|
||||
Oid typeId;
|
||||
int32 typeMod;
|
||||
Oid typeId; /* type for substituted value */
|
||||
int32 typeMod; /* typemod for substituted value */
|
||||
} ConstraintTestValue;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user