Re: regdatabase

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
Cc: Ian Lawrence Barwick <barwick(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: regdatabase
Date: 2025-05-08 03:41:23
Message-ID: aBwn49taErNbw_PQ@nathan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 07, 2025 at 10:29:43AM -0400, Greg Sabino Mullane wrote:
> On Wed, May 7, 2025 at 4:55 AM Ian Lawrence Barwick <barwick(at)gmail(dot)com>
> wrote:
>> Version which applies/builds against current HEAD attached. I haven't yet
>> had a chance to look at the code beyond fixing it, however.

I spent some time on this one. I saw two main things:

* As of commit aa01051, pg_upgrade does preserve database OIDs, so we don't
need to block for tables with columns of type regdatabase.

* Some of the regproc.c code needs to use the soft error functions instead.

I believe both of these were introduced after you wrote your original patch
in 2020. There have been a couple of refactors, too. The attached patch
should address everything I've mentioned.

> Would be nice to have test coverage of our special "single dash" case, e.g.
>
> select regdatabase('-')::oid;
> 0

Yeah, I'm not sure there's any coverage of that for the existing reg*
types, either.

--
nathan

Attachment Content-Type Size
v3-0001-Add-regdatabase.patch text/plain 20.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2025-05-08 03:51:49 Re: regdatabase
Previous Message David G. Johnston 2025-05-08 03:23:05 Re: Improve docs for n_distinct_inherited