summaryrefslogtreecommitdiff
path: root/src/backend/rewrite/rewriteManip.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-04-05 22:11:58 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-04-05 22:11:58 +0000
commit7fdb4305db20f64bce27e6bac0a0f9c972e4dec8 (patch)
tree18efa90dfcf996675cf1c7bb938d8575f7e551ad /src/backend/rewrite/rewriteManip.c
parent89a67e523e744eb168b41d192b83d17a395b4137 (diff)
downloadpostgresql-7fdb4305db20f64bce27e6bac0a0f9c972e4dec8.tar.gz
Fix a bunch of problems with domains by making them use special input functions
that apply the necessary domain constraint checks immediately. This fixes cases where domain constraints went unchecked for statement parameters, PL function local variables and results, etc. We can also eliminate existing special cases for domains in places that had gotten it right, eg COPY. Also, allow domains over domains (base of a domain is another domain type). This almost worked before, but was disallowed because the original patch hadn't gotten it quite right.
Diffstat (limited to 'src/backend/rewrite/rewriteManip.c')
-rw-r--r--src/backend/rewrite/rewriteManip.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/rewrite/rewriteManip.c b/src/backend/rewrite/rewriteManip.c
index d7cd8de677..175df7a695 100644
--- a/src/backend/rewrite/rewriteManip.c
+++ b/src/backend/rewrite/rewriteManip.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/rewrite/rewriteManip.c,v 1.97 2006/03/05 15:58:36 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/rewrite/rewriteManip.c,v 1.98 2006/04/05 22:11:55 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -860,7 +860,7 @@ resolve_one_var(Var *var, ResolveNew_context *context)
/* Otherwise replace unmatched var with a null */
/* need coerce_to_domain in case of NOT NULL domain constraint */
return coerce_to_domain((Node *) makeNullConst(var->vartype),
- InvalidOid,
+ InvalidOid, -1,
var->vartype,
COERCE_IMPLICIT_CAST,
false,