Re: regdatabase

From: Ian Lawrence Barwick <barwick(at)gmail(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: regdatabase
Date: 2025-05-07 00:18:28
Message-ID: CAB8KJ=jFEW0huiBmXVmQbGXcJM1cR5_ERC-PJ=QdC2zZZeXdCA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2025年5月7日(水) 4:29 Nathan Bossart <nathandbossart(at)gmail(dot)com>:
>
> Every once in a while, I find myself wanting to use regdatabase for
> something like current_database()::regdatabase, and I'm always surprised
> when I inevitably rediscover that it doesn't exist. I only found one
> reference to the idea in the archives [0]. So, I have two questions:
>
> * Is there an easier way to get the current database's (or any database's)
> OID that I am overlooking (besides "SELECT oid FROM pg_database...")?
>
> * Would anyone object if I put together some patches to add regdatabase?
>
> [0] https://postgr.es/m/20191109220939.jz55zcc33d3g7h7b%40alap3.anarazel.de

Hah, I put together a patch to implement just that a while back, but
then concluded
for some reason that it would likely be rejected so saved myself the
humiliation of
submitting it...

Attaching patch for reference - it's from mid 2020 so no longer applies. I'll
have a crack at cleaning it up if I get a chance.

Regards

Ian Barwick

Attachment Content-Type Size
regdatabase.v1.patch text/x-patch 17.0 KB

In response to

  • regdatabase at 2025-05-06 19:29:42 from Nathan Bossart

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Steve Chavez 2025-05-07 00:34:04 Re: Allow database owners to CREATE EVENT TRIGGER
Previous Message Mark Dilger 2025-05-07 00:11:36 Re: Adding skip scan (including MDAM style range skip scan) to nbtree