mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
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.
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/rewrite/rewriteHandler.c,v 1.161 2006/03/05 15:58:36 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/rewrite/rewriteHandler.c,v 1.162 2006/04/05 22:11:55 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -599,7 +599,7 @@ rewriteTargetList(Query *parsetree, Relation target_relation)
|
||||
att_tup->attbyval);
|
||||
/* this is to catch a NOT NULL domain constraint */
|
||||
new_expr = coerce_to_domain(new_expr,
|
||||
InvalidOid,
|
||||
InvalidOid, -1,
|
||||
att_tup->atttypid,
|
||||
COERCE_IMPLICIT_CAST,
|
||||
false,
|
||||
|
Reference in New Issue
Block a user