Re: Handling OID Changes in Regression Tests for C Extensions

From: Tomas Vondra <tomas(at)vondra(dot)me>
To: Lakshmi Narayana Velayudam <dev(dot)narayana(dot)v(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Handling OID Changes in Regression Tests for C Extensions
Date: 2025-06-14 13:50:56
Message-ID: 03a84c40-870d-4a0d-a5df-314ad40f98c9@vondra.me
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello Narayana,

On 6/14/25 11:43, Lakshmi Narayana Velayudam wrote:
> Dear pg-hackers,
>
> I am facing a challenge related to OID changes in regression tests while
> working on a PostgreSQL C extension. Whenever I add or remove a function
> to the SQL file, it alters OIDs and leads to cascading modifications in
> multiple test files. This creates a significant overhead in maintaining
> the regression tests.
>
> I would like to understand if there are best practices or tools used in
> PostgreSQL's own regression test suite to handle or mitigate the impact
> of OID changes. How does PostgreSQL manage OIDs in its tests to minimize
> disruption? Are there strategies, configurations, or patterns that can
> be recommended for extensions?
>
> Any guidance or reference to documentation on this topic would be
> greatly appreciated.
>

The OIDs for user-defined objects (e.g. those from extensions) are not
stable, and this will not change. The only way is to prevent the test
output, e.g. by not including OIDs in the results, and eliminating all
other types of non-determinism - eg. by enforcing ordering, etc.

regards

--
Tomas Vondra

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2025-06-14 13:56:34 Re: Improve CRC32C performance on SSE4.2
Previous Message Tomas Vondra 2025-06-14 13:47:33 Re: Improve CRC32C performance on SSE4.2