Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit942702a

Browse files
committed
When you do "ARRAY[...]::domain", where domain is a domain over an array type,
we need to check domain constraints. We used to do it correctly, but 8.4introduced a separate code path for the "ARRAY[]::arraytype" case to inferthe type of an empty ARRAY construct from the cast target, and forgot to takedomains into account.Per report from Florian G. Pflug.
1 parent5e75f67 commit942702a

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

‎src/backend/parser/parse_expr.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/parser/parse_expr.c,v 1.248 2009/11/09 02:36:56 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/parser/parse_expr.c,v 1.249 2009/11/13 16:09:10 heikki Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -169,6 +169,20 @@ transformExpr(ParseState *pstate, Node *expr)
169169
targetType,
170170
elementType,
171171
targetTypmod);
172+
173+
/*
174+
* If the target array type is a domain, we still need
175+
* to check the domain constraint. (coerce_to_domain
176+
* is a no-op if targetType is not a domain)
177+
*/
178+
result=coerce_to_domain(result,
179+
InvalidOid,
180+
-1,
181+
targetType,
182+
COERCE_IMPLICIT_CAST,
183+
tc->location,
184+
false,
185+
true);
172186
break;
173187
}
174188

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp