File tree 2 files changed +8
-4
lines changed
contrib/postgres_fdw/expected
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');
2717
2717
-- regress_view_owner_another, the view owner, though it fails as expected
2718
2718
-- due to the lack of a user mapping for that user.
2719
2719
EXPLAIN (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 "
2721
2721
-- Likewise, but with the query under an UNION ALL
2722
2722
EXPLAIN (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 "
2724
2724
-- Should not get that error once a user mapping is created
2725
2725
CREATE USER MAPPING FOR regress_view_owner_another SERVER loopback OPTIONS (password_required 'false');
2726
2726
EXPLAIN (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)
217
217
}
218
218
219
219
if (!HeapTupleIsValid (tp ))
220
+ {
221
+ ForeignServer * server = GetForeignServer (serverid );
222
+
220
223
ereport (ERROR ,
221
224
(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
+ }
224
228
225
229
um = (UserMapping * ) palloc (sizeof (UserMapping ));
226
230
um -> umid = ((Form_pg_user_mapping ) GETSTRUCT (tp ))-> oid ;
You can’t perform that action at this time.
0 commit comments