Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f70f095

Browse files
committed
Allow new relmapper entries when allow_system_table_mods is true.
This restores the pre-9.0 situation that it's possible to add new indexes on pg_class and other mapped-but-not-shared catalogs, so long as you broke the glass and flipped the big red Dont-Touch-Me switch. As before, there are a lot of gotchas, and you'd have to be pretty desperate to try this on a production database; but there doesn't seem to be a reason for relmapper.c to be preventing such things all by itself. Per experimentation with a case suggested by Cody Cutrer.
1 parent 99081c6 commit f70f095

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/backend/utils/cache/relmapper.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -837,8 +837,11 @@ perform_relmap_update(bool shared, const RelMapFile *updates)
837837
else
838838
memcpy(&newmap, &local_map, sizeof(RelMapFile));
839839

840-
/* Apply the updates to newmap. No new mappings should appear. */
841-
merge_map_updates(&newmap, updates, false);
840+
/*
841+
* Apply the updates to newmap. No new mappings should appear, unless
842+
* somebody is adding indexes to system catalogs.
843+
*/
844+
merge_map_updates(&newmap, updates, allowSystemTableMods);
842845

843846
/* Write out the updated map and do other necessary tasks */
844847
write_relmap_file(shared, &newmap, true, true, true,

0 commit comments

Comments
 (0)