mirror of
https://github.com/postgres/postgres.git
synced 2025-06-25 01:02:05 +03:00
Restrict name list len for domain constraints
This avoids an ugly-looking "cache lookup failure" message. Ugliness pointed out by Andres Freund.
This commit is contained in:
@ -1534,6 +1534,12 @@ pg_get_object_address(PG_FUNCTION_ARGS)
|
||||
*/
|
||||
switch (type)
|
||||
{
|
||||
case OBJECT_DOMCONSTRAINT:
|
||||
if (list_length(name) < 2)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("name list length must be at least %d", 2)));
|
||||
break;
|
||||
case OBJECT_LARGEOBJECT:
|
||||
if (list_length(name) != 1)
|
||||
ereport(ERROR,
|
||||
|
Reference in New Issue
Block a user