diff options
author | Robert Haas <rhaas@postgresql.org> | 2011-06-17 13:34:39 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2011-06-17 13:34:39 -0400 |
commit | bf347c60bdd7e05800f0c06d03e2ad87aeaa5e09 (patch) | |
tree | 0069b54a0fbe5ecbf41027bdf5a66b9998a8327f /src | |
parent | c573486ce9752afb9a8431089762d6845cf1429d (diff) | |
download | postgresql-bf347c60bdd7e05800f0c06d03e2ad87aeaa5e09.tar.gz postgresql-bf347c60bdd7e05800f0c06d03e2ad87aeaa5e09.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/catalog/heap.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index 67a7749a30b..e606ac2b9ed 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -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, |