Hello
We already have function pg_get_userbyid(oid) with lookup in pg_authid catalog. My collegue ask me can we add similar
functionpg_get_databasebyid(oid) with lookup in pg_databases.
It is simple function to get a database name by oid and fallback to 'unknown (OID=n)' if missing.
The proposed patch is attached. Currently I missed the tests - I doubt which file in src/test/regress/sql/ is the most
suitable.pg_get_userbyid is called from privileges.sql only.
regards, Sergei