Re: Avoid orphaned objects dependencies, take 3
Jeff Davis <pgsql@j-davis.com>
From: Jeff Davis <pgsql@j-davis.com>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.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-16T01:19:19Z
Lists: pgsql-hackers
On Wed, 2026-06-10 at 15:16 +0000, Bertrand Drouvot wrote:
> PFA a new version of v26, it adds a new test as compared to the v26
> previously
> shared.
I'd like to avoid adding lines to AbortTransaction(). Also, I think it
might miss subtransaction aborts, which could be relevant in complex
cases with SPI.
Can you use a structure like:
ProcessUtility()
{
TrackAclTable *prevTrackAclTable = CurrentTrackAclTable;
/* allocates in CurrentMemoryContext */
CurrentTrackAclTable = NewTrackAclTable();
PG_TRY();
{
... rest of ProcessUtility ...
}
PG_FINALLY();
{
FreeTrackAclTable(CurrentTrackAclTable);
CurrentTrackAclTable = prevTrackAclTable;
}
PG_END_TRY();
}
That would avoid the need to create a special memory context; you could
just repalloc() the chunk allocated for the table. It would also mean
you don't have to track the stack frames manually with a counter, just
use a local variable.
Also, are you sure that the two call sites for aclcheck_track_record()
are enough? Or do we need checks in e.g. pg_attribute_aclcheck() as
well?
Regards,
Jeff Davis
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