public inbox for [email protected]
help / color / mirror / Atom feedFrom: David G. Johnston <[email protected]>
To: Tom Lane <[email protected]>
Cc: Álvaro Herrera <[email protected]>
Cc: Sebastien Flaesch <[email protected]>
Cc: Adrian Klaver <[email protected]>
Cc: M Tarkeshwar Rao <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: After upgrading libpq, the same function(PQftype) call returns a different OID
Date: Thu, 20 Mar 2025 13:08:54 -0700
Message-ID: <CAKFQuwZYCktj5Ect4f5Mx1OejCRbQ+MoKWQN+F=2Oid5M=3E7Q@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
On Thu, Mar 20, 2025 at 11:54 AM Tom Lane <[email protected]> wrote:
> =?utf-8?Q?=C3=81lvaro?= Herrera <[email protected]> writes:
> > That said, we could add a comment that makes this more obvious:
> > ...
> > This looks a tad redundant in pg_type.h itself, but makes the generated
> > pg_type_d.h file more obvious:
>
> I think it's a mistake to suppose that pg_type_d.h is the only
> place where there's a risk of confusion. We should be thinking
> about this more generally: genbki.pl is taking zero thought to
> make what it emits readable. I think it would help to
> label the sections it emits, perhaps along the lines of
>
> /* Auto-generated OID macros */
>
> for this part, and I'm not sure what other parts would be useful
> to label.
>
I'd consider this enough for the moment, so long as we explicitly address
the cross-version constancy of the OID values associated with each type.
I think any other useful comments we'd want to include could be
sufficiently handled with one added general facility:
/*-------------------------------------------------------------------------
*
* %s
* %s
*
* Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* NOTES
* ******************************
* *** DO NOT EDIT THIS FILE! ***
* ******************************
*
* It has been GENERATED by src/backend/catalog/genbki.pl
*
*-------------------------------------------------------------------------
* %s - have a spot in the *.h files to write some additional comments and
then inject them here if present
*/
I'm not going to dive deep enough to make more targeted suggestions. It
does seem, though, that "client code" would seem mostly interested in these
OIDs and not stuff like the attribute numbers of the columns in pg_type. I
get a distinct feel of one file serving multiple use cases.
> As for CASHOID and LSNOID, surely those have been deprecated long
> enough that we could just remove them?
>
>
I'd probably just leave them.
David J.
view thread (17+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: After upgrading libpq, the same function(PQftype) call returns a different OID
In-Reply-To: <CAKFQuwZYCktj5Ect4f5Mx1OejCRbQ+MoKWQN+F=2Oid5M=3E7Q@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox