Re: Avoid orphaned objects dependencies, take 3
Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>, Robert Haas <robertmhaas@gmail.com>, Roman Eskin <r.eskin@arenadata.io>, Michael Paquier <michael@paquier.xyz>, Alexander Lakhin <exclusion@gmail.com>, pgsql-hackers@lists.postgresql.org, Tom Lane <tgl@sss.pgh.pa.us>
Date: 2026-06-25T11:10:58Z
Lists: pgsql-hackers
Attachments
Hi, On Fri, Jun 19, 2026 at 01:28:21PM +0000, Bertrand Drouvot wrote: > Hi, > > On Thu, Jun 18, 2026 at 04:21:33PM -0700, Jeff Davis wrote: > > > We could keep the transaction ID in the tracking record, and ignore > > entries from an aborted subxact. But it's getting fairly complex and > > delicate. As discussed off-list, let's move forward with this proposal (as the save a copy of the object's ACL + ROLE membership mentioned in [1] would be more complex and fragile). So PFA the new version doing so. It's the same patch series as the previous one except that it adds: 0004: Discard ACL tracking entries from aborted subtransactions It stores SubTransactionId in each AclCheckEntry at recording time. On subtransaction abort, AtEOSubXact_AclTrack() discards entries whose subxid is >= the aborting subtransaction's ID. The code is pretty simple but I suspect that adding a test would probably need to create a brand new module (say test_acltrack) with C code forcing recordDependencyOn() and BeginInternalSubTransaction()) and I'm not sure it's worth it. Indeed, I think the test would need to do things similar to what you shared in [2]. The patch is split to ease the review but should probably be merged as a single patch. [1]: https://postgr.es/m/ajVF7YWf%2Bpxs4cOf%40bdtpg [2]: https://postgr.es/m/5c629d2455946ad2fde3c184f64ea2c323ef2133.camel@j-davis.com Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Avoid orphaned objects dependencies
- 2fbb21170e90 19 (unreleased) landed
- 5100bdbd3ba2 14 (unreleased) landed
- 5fa137727db0 15 (unreleased) landed
- d9bc0d96c247 16 (unreleased) landed
- 3a9909eda207 17 (unreleased) landed
- c8cd3d6976f7 18 (unreleased) landed
-
Don't try to record dependency on a dropped column's datatype
- fd93ee100830 19 (unreleased) landed
- 36b6ed2606e1 14 (unreleased) landed
- ef3d7b15e4cd 15 (unreleased) landed
- d44cd467471c 16 (unreleased) landed
- c1588f92a915 17 (unreleased) landed
- f9d5a52da4ca 18 (unreleased) landed