patch: improve "user mapping not found" error message

Ian Lawrence Barwick <barwick@gmail.com>

From: Ian Lawrence Barwick <barwick@gmail.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2023-06-23T07:45:05Z
Lists: pgsql-hackers

Attachments

Hi

Mild corner-case annoyance while doing Random Experimental Things:

    postgres=# SELECT * FROM parttest;
    ERROR:  user mapping not found for "postgres"

Okaaaay, but which server?

    postgres=# \det
           List of foreign tables
     Schema |     Table     |   Server
    --------+---------------+-----------
     public | parttest_10_1 | fdw_node2
     public | parttest_10_3 | fdw_node3
     public | parttest_10_5 | fdw_node4
     public | parttest_10_7 | fdw_node5
     public | parttest_10_9 | fdw_node6
    (5 rows)

(Muffled sound of small patch hatching) aha:

    postgres=# SELECT * FROM parttest;
    ERROR:  user mapping not found for user "postgres", server "fdw_node5"

Regards

Ian Barwick

Commits

  1. Improve "user mapping not found" error message