diff options
| author | Alexander Korotkov | 2024-04-11 12:54:25 +0000 |
|---|---|---|
| committer | Alexander Korotkov | 2024-04-11 13:02:49 +0000 |
| commit | 922c4c461d213a422ee7eb6c38e399607539210a (patch) | |
| tree | dcd17814810d1637851b2012acd5bf12c018d463 /src/backend | |
| parent | 8dd0bb84da7d56a9e41241b26bfbf6b79644d574 (diff) | |
Revert: Allow table AM to store complex data structures in rd_amcache
This commit reverts 02eb07ea89 per review by Andres Freund.
Discussion: https://postgr.es/m/20240410165236.rwyrny7ihi4ddxw4%40awork3.anarazel.de
Diffstat (limited to 'src/backend')
| -rw-r--r-- | src/backend/access/heap/heapam_handler.c | 1 | ||||
| -rw-r--r-- | src/backend/utils/cache/relcache.c | 11 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/backend/access/heap/heapam_handler.c b/src/backend/access/heap/heapam_handler.c index c019d96a162..3428d80817c 100644 --- a/src/backend/access/heap/heapam_handler.c +++ b/src/backend/access/heap/heapam_handler.c @@ -2656,7 +2656,6 @@ static const TableAmRoutine heapam_methods = { .index_validate_scan = heapam_index_validate_scan, .relation_analyze = heapam_analyze, - .free_rd_amcache = NULL, .relation_size = table_block_relation_size, .relation_needs_toast_table = heapam_relation_needs_toast_table, .relation_toast_am = heapam_relation_toast_am, diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index 3fe74dabd00..262c9878dd3 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -2269,7 +2269,9 @@ RelationReloadIndexInfo(Relation relation) RelationCloseSmgr(relation); /* Must free any AM cached data upon relcache flush */ - table_free_rd_amcache(relation); + if (relation->rd_amcache) + pfree(relation->rd_amcache); + relation->rd_amcache = NULL; /* * If it's a shared index, we might be called before backend startup has @@ -2489,7 +2491,8 @@ RelationDestroyRelation(Relation relation, bool remember_tupdesc) pfree(relation->rd_options); if (relation->rd_indextuple) pfree(relation->rd_indextuple); - table_free_rd_amcache(relation); + if (relation->rd_amcache) + pfree(relation->rd_amcache); if (relation->rd_fdwroutine) pfree(relation->rd_fdwroutine); if (relation->rd_indexcxt) @@ -2551,7 +2554,9 @@ RelationClearRelation(Relation relation, bool rebuild) RelationCloseSmgr(relation); /* Free AM cached data, if any */ - table_free_rd_amcache(relation); + if (relation->rd_amcache) + pfree(relation->rd_amcache); + relation->rd_amcache = NULL; /* * Treat nailed-in system relations separately, they always need to be |
