Re: pg_get_databasebyid(oid)

2019-09-04 Thread Sergei Kornilov
Hello Thank you for attention! I marked CF entry as returned with feedback. regards, Sergei

Re: pg_get_databasebyid(oid)

2019-09-03 Thread Michael Paquier
On Thu, Aug 29, 2019 at 03:47:40PM +0500, Ibrar Ahmed wrote: > I think its a user request and don't require to be in the core of > PostgreSQL. > A simple SQL function can fulfill the requirement of the user. > > CREATE OR REPLACE FUNCTION pg_get_databasebyid(dboid integer) RETURNS name > AS $$ >

Re: pg_get_databasebyid(oid)

2019-08-29 Thread Ibrar Ahmed
On Thu, Aug 29, 2019 at 3:16 PM Sergei Kornilov wrote: > Hello > > > Is there a need for this function for the user? > > This was feature request from user. I got such comment: > > This function is useful when working with pg_stat_statements. For > obtaining a databаse name for particular query y

Re: pg_get_databasebyid(oid)

2019-08-29 Thread Sergei Kornilov
Hello > Is there a need for this function for the user? This was feature request from user. I got such comment: This function is useful when working with pg_stat_statements. For obtaining a databаse name for particular query you need to join pg_database relation, but for obtaining an username

Re: pg_get_databasebyid(oid)

2019-08-29 Thread Ibrar Ahmed
On Wed, Aug 28, 2019 at 6:05 PM Sergei Kornilov wrote: > > Please add that to commitfest. > > Done: https://commitfest.postgresql.org/24/2261/ > > regards, Sergei > Hi, I have checked the code, the function "pg_get_userbyid" is used in many places in code. I am just curious why we need that "pg

Re: pg_get_databasebyid(oid)

2019-08-28 Thread Sergei Kornilov
> Please add that to commitfest. Done: https://commitfest.postgresql.org/24/2261/ regards, Sergei

Re: pg_get_databasebyid(oid)

2019-08-28 Thread Ibrar Ahmed
On Wed, Aug 28, 2019 at 5:38 PM Sergei Kornilov wrote: > 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

pg_get_databasebyid(oid)

2019-08-28 Thread Sergei Kornilov
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 mis