mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-06 15:24:56 +08:00
Fix crash in CREATE UNLOGGED TABLE.
The code that created the init fork neglected to make sure that the relation was open at the smgr level before attempting to invoke smgr. This didn't happen every time; only when the relcache entry was rebuilt along the way. Per report from Garick Hamlin.
This commit is contained in:
parent
c573486ce9
commit
bf347c60bd
@ -1295,6 +1295,7 @@ heap_create_with_catalog(const char *relname,
|
||||
{
|
||||
Assert(relkind == RELKIND_RELATION || relkind == RELKIND_TOASTVALUE);
|
||||
|
||||
RelationOpenSmgr(new_rel_desc);
|
||||
smgrcreate(new_rel_desc->rd_smgr, INIT_FORKNUM, false);
|
||||
if (XLogIsNeeded())
|
||||
log_smgrcreate(&new_rel_desc->rd_smgr->smgr_rnode.node,
|
||||
|
Loading…
Reference in New Issue
Block a user