From: | Sergei Kornilov <sk(at)zsrv(dot)org> |
---|---|
To: | PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>, alexey(dot)lesovsky(at)dataegret(dot)com |
Subject: | pg_get_databasebyid(oid) |
Date: | 2019-08-28 12:38:42 |
Message-ID: | 7891121566995922@sas2-a74be5364cfb.qloud-c.yandex.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hello
We already have function pg_get_userbyid(oid) with lookup in pg_authid catalog. My collegue ask me can we add similar function pg_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
Attachment | Content-Type | Size |
---|---|---|
v1_pg_get_databasebyid.patch | text/x-diff | 3.5 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Ibrar Ahmed | 2019-08-28 12:49:40 | Re: pg_get_databasebyid(oid) |
Previous Message | nilsocket | 2019-08-28 12:16:03 | Doubt regarding logical decoding |