mirror of
https://github.com/postgres/postgres.git
synced 2025-11-07 19:06:32 +03:00
Improve "user mapping not found" error message
Display the name of the foreign server for which the user mapping was not found. Author: Ian Lawrence Barwick <barwick@gmail.com> Reviewed-by: Laurenz Albe <laurenz.albe@cybertec.at> Reviewed-by: Peter Eisentraut <peter@eisentraut.org> Discussion: https://www.postgresql.org/message-id/flat/CAB8KJ=jFzNaeyFtLcTZNOc6fd1+F93pGVLFa-wyt31wn7VNxqQ@mail.gmail.com
This commit is contained in:
@@ -217,10 +217,14 @@ GetUserMapping(Oid userid, Oid serverid)
|
||||
}
|
||||
|
||||
if (!HeapTupleIsValid(tp))
|
||||
{
|
||||
ForeignServer *server = GetForeignServer(serverid);
|
||||
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_UNDEFINED_OBJECT),
|
||||
errmsg("user mapping not found for \"%s\"",
|
||||
MappingUserName(userid))));
|
||||
errmsg("user mapping not found for user \"%s\", server \"%s\"",
|
||||
MappingUserName(userid), server->servername)));
|
||||
}
|
||||
|
||||
um = (UserMapping *) palloc(sizeof(UserMapping));
|
||||
um->umid = ((Form_pg_user_mapping) GETSTRUCT(tp))->oid;
|
||||
|
||||
Reference in New Issue
Block a user