Re: Pro et contra of preserving pg_proc oids during pg_upgrade

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Nikita Malakhov <hukutoc(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Pro et contra of preserving pg_proc oids during pg_upgrade
Date: 2023-10-12 22:28:51
Message-ID: CAKFQuwYworUX1DCkc3WB82Ld2mkB+HB_uasnqkN0DWwc7zCBdg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 12, 2023 at 2:58 PM Nikita Malakhov <hukutoc(at)gmail(dot)com> wrote:

> Why pg_upgrade cannot be used?
>

We document both a pg_dump/pg_restore migration and a pg_upgrade one (not
to mention that logical backup and restore would cause the oids to
change). It seems odd to have a feature that requires pg_upgrade to be the
chosen one. pg_upgrade is an option, not a requirement. Same goes for
pg_basebackup.

pg_upgrade itself warns that should the on-disk file format change then it
would be unusable - though I suspect that we'd end up with some kind of
hybrid approach in that case.

> OID preservation logic is already implemented
> for several OIDs in catalog tables, like pg_class, type, relfilenode,
> enum...
>
>
We are allowed to preserve oids if we wish but that doesn't mean we must,
nor does doing so constitute a declaration that such oids are part of
the public API. And I don't see us making OIDs part of the public API
unless we modify pg_dump to include them in its output.

> Actually, I've asked here because there are several references to PG_PROC
> oids
> from other tables in the system catalog
>

Of course there are, e.g., views depending on functions would result is
those. But pg_upgrade et al. recomputes the views so the changing of oids
isn't a problem.

Long text fields are common in databases; and if there are concerns with
parsing/interpretation we can add functions to make doing that simpler.

David J.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2023-10-12 22:38:40 BRIN minmax multi - incorrect distance for infinite timestamp/date
Previous Message Nikita Malakhov 2023-10-12 21:57:53 Re: Pro et contra of preserving pg_proc oids during pg_upgrade