Re: Test cluster with high OIDs above the signed-int limit (2B+) - Mailing list pgsql-general

From Ron Johnson
Subject Re: Test cluster with high OIDs above the signed-int limit (2B+)
Date
Msg-id CANzqJaAWuD+JBk03Q02=UBLAPBsOonyww7xsPon9Op_zk-4EDw@mail.gmail.com
Whole thread
In response to Re: Test cluster with high OIDs above the signed-int limit (2B+)  (Dominique Devienne <ddevienne@gmail.com>)
Responses Re: Test cluster with high OIDs above the signed-int limit (2B+)
List pgsql-general
On Mon, Apr 20, 2026 at 9:08 AM Dominique Devienne <ddevienne@gmail.com> wrote:
On Mon, Apr 20, 2026 at 2:59 PM Dominique Devienne <ddevienne@gmail.com> wrote:
> No. I don't even remember the exact bug

Was an old test using lo_creat(-1) RETURNING the OID, and code doing
`std::stoi(PQgetvalue(...))`. In production we don't use LO and use
the binary protocol, so no such issue, still my original point
remains. We process OIDs in several places, and making sure our test
suite works with high OIDs would be better. If I fully control the
cluster, which is created specifically for the test run, on-the-fly,
it's like to be able to similate high OIDs "instantly".

It's an unsigned integer, so I'd say not use signed ints when processing OIDs.

It's a valid question, though, what happens when the OID counter wraps around and hits a duplicate.

--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

pgsql-general by date:

Previous
From: Dominique Devienne
Date:
Subject: Re: Test cluster with high OIDs above the signed-int limit (2B+)
Next
From: Tom Lane
Date:
Subject: Re: Test cluster with high OIDs above the signed-int limit (2B+)