Remove the refint contrib module (for v20)

From: Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Álvaro Herrera <alvherre(at)kurilemu(dot)de>, Nathan Bossart <nathandbossart(at)gmail(dot)com>
Subject: Remove the refint contrib module (for v20)
Date: 2026-06-05 19:27:56
Message-ID: CAJTYsWUHq8Ohc6-N-xamOPYz-q3qUYMtwQX-1=Zi=5N1Q_GSEQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

This is intended for v20.

refint has long been documented as superseded by the built-in foreign
key mechanism, and the recent run of fixes (cascade-UPDATE NULL
crash, SQL-injection docs, removal of the broken private SPI plan
cache) suggests it's costing more to maintain than its sample-code
value justifies. On the plan-cache thread [1], the idea of just
removing it in v20 came up and seemed to have some agreement, so
moving that to its own thread to discuss on its own terms.

The patch set is two pieces:

0001 removes refint:
- removes refint.c, refint.control, refint--1.0.sql, refint.example,
sql/refint.sql and expected/refint.out from contrib/spi/;
- drops refint from contrib/spi/Makefile and contrib/spi/meson.build,
the refint section from doc/src/sgml/contrib-spi.sgml, and the
now-unused EPlan typedef from src/tools/pgindent/typedefs.list.

0002 (test-only) teaches AdjustUpgrade.pm to drop the refint
extension and its leftover tables (pkeys, fkeys, fkeys2) from
contrib_regression_spi / regression_spi when upgrading from a version
that still shipped refint, so cross-version pg_upgrade tests don't
fail dump comparison once v20 opens.
I followed the existing < 19 btree_gist block style.

If we go ahead with this, a release-notes entry can land once
doc/src/sgml/release-20.sgml is created.

I can't run cross-version upgrade tests against v20 yet, so
the 0002 hunk would benefit from a look by someone with an xversion
buildfarm animal.

Thoughts? Does this look like the right approach, or is there a
reason to keep refint around?

[1] PostgreSQL: [PATCH] refint: Avoid reusing cascade UPDATE plans.
<https://www.postgresql.org/message-id/flat/CAJTYsWXU%2BfhuzrEd_bnrxyGH3%2Bny8QRQC2QHf3ws6s9iki3c2Q%40mail.gmail.com>

Regards,
Ayush

Attachment Content-Type Size
v1-0001-Remove-the-refint-contrib-module.patch application/octet-stream 35.1 KB
v1-0002-Handle-refint-removal-in-cross-version-pg_upgrade-te.patch application/octet-stream 1.9 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2026-06-05 19:29:17 Re: First draft of PG 19 release notes
Previous Message Jacob Champion 2026-06-05 19:27:50 Re: [PATCH] CI: Add a CPAN cache on Windows