Re: regdatabase

Ian Lawrence Barwick <barwick@gmail.com>

From: Ian Lawrence Barwick <barwick@gmail.com>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Greg Sabino Mullane <htamfids@gmail.com>, pgsql-hackers@postgresql.org
Date: 2025-05-08T13:38:04Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add new OID alias type regdatabase.

  2. pg_upgrade: Preserve database OIDs.

Attachments

2025年5月8日(木) 12:41 Nathan Bossart <nathandbossart@gmail.com>:
>
> 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@gmail.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.

Thanks for looking at that, I likely wouldn't have got to it for a
couple of days.

> > 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.

Revised patch attached which adds coverage of that and also for the
"constant of the type reg(role|database) cannot be used here" error.

Regards

Ian Barwick