Re: After upgrading libpq, the same function(PQftype) call returns a different OID - Mailing list pgsql-general

From Sebastien Flaesch
Subject Re: After upgrading libpq, the same function(PQftype) call returns a different OID
Date
Msg-id DBAP191MB12895511C8AF01672076F8E3B0D82@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM
Whole thread Raw
In response to Re: After upgrading libpq, the same function(PQftype) call returns a different OID  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: After upgrading libpq, the same function(PQftype) call returns a different OID
Re: After upgrading libpq, the same function(PQftype) call returns a different OID
List pgsql-general
Tom,
They are.  You were already pointed to it. The fact that you don't
like how that file's name is spelled is not really going to
impress anyone.
I don't care about the .h file name or location, what scares me is this:

/*
 * Backwards compatibility for ancient random spellings of pg_type OID macros.
 * Don't use these names in new code.
 */
#define CASHOID MONEYOID
#define LSNOID  PG_LSNOID

#define BOOLOID 16
#define BYTEAOID 17
#define CHAROID 18
#define NAMEOID 19
#define INT8OID 20
#define INT2OID 21
#define INT2VECTOROID 22
#define INT4OID 23
#define REGPROCOID 24

If I am missing something, then please point me to the correct .h file that contains #define constants without this scary comment.

OR.... ( I guess I start to understand the code... ) it this comment only for:

#define CASHOID MONEYOID
#define LSNOID  PG_LSNOID

???

And sorry if I consider constant names like these (without any prefix such as PG_TYPE_)

#define BOOLOID 16
#define BYTEAOID 17
#define CHAROID 18
#define NAMEOID 19
#define INT8OID 20
#define INT2OID 21
...

... are looking more like names not to be used!

Arrogance does not help here, clarity and better API doc would.

Seb

From: Tom Lane <tgl@sss.pgh.pa.us>
Sent: Thursday, March 20, 2025 3:31 PM
To: Sebastien Flaesch <sebastien.flaesch@4js.com>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>; M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>; pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: After upgrading libpq, the same function(PQftype) call returns a different OID
 
EXTERNAL: Do not click links or open attachments if you do not recognize the sender.

Sebastien Flaesch <sebastien.flaesch@4js.com> writes:
> Native PostgreSQL built-in SQL types should be listed in a .h header of the C client API

They are.  You were already pointed to it. The fact that you don't
like how that file's name is spelled is not really going to
impress anyone.

                        regards, tom lane

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Bloated toast table with empty associated table
Next
From: Dominique Devienne
Date:
Subject: Re: After upgrading libpq, the same function(PQftype) call returns a different OID