File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
contrib/postgres_fdw/expected Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -2717,10 +2717,10 @@ ALTER FOREIGN TABLE ft4 OPTIONS (ADD use_remote_estimate 'true');
27172717-- regress_view_owner_another, the view owner, though it fails as expected
27182718-- due to the lack of a user mapping for that user.
27192719EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM v4;
2720- ERROR: user mapping not found for "regress_view_owner_another"
2720+ ERROR: user mapping not found for user "regress_view_owner_another", server "loopback "
27212721-- Likewise, but with the query under an UNION ALL
27222722EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM (SELECT * FROM v4 UNION ALL SELECT * FROM v4);
2723- ERROR: user mapping not found for "regress_view_owner_another"
2723+ ERROR: user mapping not found for user "regress_view_owner_another", server "loopback "
27242724-- Should not get that error once a user mapping is created
27252725CREATE USER MAPPING FOR regress_view_owner_another SERVER loopback OPTIONS (password_required 'false');
27262726EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM v4;
Original file line number Diff line number Diff line change @@ -217,10 +217,14 @@ GetUserMapping(Oid userid, Oid serverid)
217217 }
218218
219219 if (!HeapTupleIsValid (tp ))
220+ {
221+ ForeignServer * server = GetForeignServer (serverid );
222+
220223 ereport (ERROR ,
221224 (errcode (ERRCODE_UNDEFINED_OBJECT ),
222- errmsg ("user mapping not found for \"%s\"" ,
223- MappingUserName (userid ))));
225+ errmsg ("user mapping not found for user \"%s\", server \"%s\"" ,
226+ MappingUserName (userid ), server -> servername )));
227+ }
224228
225229 um = (UserMapping * ) palloc (sizeof (UserMapping ));
226230 um -> umid = ((Form_pg_user_mapping ) GETSTRUCT (tp ))-> oid ;
You can’t perform that action at this time.
0 commit comments