Re: About adding a new filed to a struct in primnodes.h

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: About adding a new filed to a struct in primnodes.h
Date: 2020-11-25 03:54:42
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com> writes:
> On Wed, Nov 25, 2020 at 9:40 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> What exactly would be the value of that?
>> ...

> I agree with this, but I don't think there is no value in my suggestion
> unless I missed something. Per my current understanding, the code
> is too easy to make the datadir incompatible with binary, which requires
> user to do some extra work and my suggestion is to avoid that and
> it is the value.

It'd be fairly pointless to worry about this so far as ordinary users are
concerned, who are only going to encounter the situation in connection
with a major-version upgrade. There is no way that the only catalog
incompatibility they'd face is an addition or removal of a field in some
query node. In practice, a major-version upgrade is also going to
involve things like these:

* addition (or, sometimes, removal) of entire system catalogs
* addition, removal, or redefinition of columns within an existing catalog
* addition or removal of standard entries in system catalogs
* restructuring of stored rules/expressions in ways that are more
complicated than simple addition/removal of fields

The second of those, in particular, is quite fatal to any idea of
making a version-N backend executable work with version-not-N
catalogs. Catalog rowtypes are wired into the C code at a pretty
basic level.

We already sweat a great deal to make user table contents be upwards
compatible across major versions. I think that trying to take on
some similar guarantee with respect to system catalog contents would
serve mostly to waste a lot of developer manpower that can be put to
much better uses.

regards, tom lane

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2020-11-25 03:57:47 Re: WIP: WAL prefetch (another approach)
Previous Message Michael Paquier 2020-11-25 03:41:25 Re: Add table access method as an option to pgbench