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

Commit6630420

Browse files
committed
Restrict name list len for domain constraints
This avoids an ugly-looking "cache lookup failure" message.Ugliness pointed out by Andres Freund.
1 parent289121a commit6630420

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

‎src/backend/catalog/objectaddress.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,6 +1534,12 @@ pg_get_object_address(PG_FUNCTION_ARGS)
15341534
*/
15351535
switch (type)
15361536
{
1537+
caseOBJECT_DOMCONSTRAINT:
1538+
if (list_length(name)<2)
1539+
ereport(ERROR,
1540+
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1541+
errmsg("name list length must be at least %d",2)));
1542+
break;
15371543
caseOBJECT_LARGEOBJECT:
15381544
if (list_length(name)!=1)
15391545
ereport(ERROR,

‎src/test/regress/expected/object_address.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ WARNING: error for table constraint,{addr_nsp,zwei},{}: relation "addr_nsp" doe
171171
WARNING: error for table constraint,{addr_nsp,zwei},{integer}: relation "addr_nsp" does not exist
172172
WARNING: error for table constraint,{eins,zwei,drei},{}: schema "eins" does not exist
173173
WARNING: error for table constraint,{eins,zwei,drei},{integer}: schema "eins" does not exist
174-
WARNING: error for domain constraint,{eins},{}:cache lookup failed for type 0
175-
WARNING: error for domain constraint,{eins},{integer}:cache lookup failed for type 0
174+
WARNING: error for domain constraint,{eins},{}:name list length must be at least 2
175+
WARNING: error for domain constraint,{eins},{integer}:name list length must be at least 2
176176
WARNING: error for domain constraint,{addr_nsp,zwei},{}: type "addr_nsp" does not exist
177177
WARNING: error for domain constraint,{addr_nsp,zwei},{integer}: type "addr_nsp" does not exist
178178
WARNING: error for domain constraint,{eins,zwei,drei},{}: schema "eins" does not exist

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp