mirror of
https://github.com/postgres/postgres.git
synced 2025-11-07 19:06:32 +03:00
Phase 1 of fix for 'SMgrRelation hashtable corrupted' problem. This
is the minimum required fix. I want to look next at taking advantage of it by simplifying the message semantics in the shared inval message queue, but that part can be held over for 8.1 if it turns out too ugly.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/utils/rel.h,v 1.81 2004/12/31 22:03:46 pgsql Exp $
|
||||
* $PostgreSQL: pgsql/src/include/utils/rel.h,v 1.82 2005/01/10 20:02:24 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -233,6 +233,31 @@ typedef Relation *RelationPtr;
|
||||
#define RelationGetNamespace(relation) \
|
||||
((relation)->rd_rel->relnamespace)
|
||||
|
||||
/*
|
||||
* RelationOpenSmgr
|
||||
* Open the relation at the smgr level, if not already done.
|
||||
*/
|
||||
#define RelationOpenSmgr(relation) \
|
||||
do { \
|
||||
if ((relation)->rd_smgr == NULL) \
|
||||
smgrsetowner(&((relation)->rd_smgr), smgropen((relation)->rd_node)); \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* RelationCloseSmgr
|
||||
* Close the relation at the smgr level, if not already done.
|
||||
*
|
||||
* Note: smgrclose should unhook from owner pointer, hence the Assert.
|
||||
*/
|
||||
#define RelationCloseSmgr(relation) \
|
||||
do { \
|
||||
if ((relation)->rd_smgr != NULL) \
|
||||
{ \
|
||||
smgrclose((relation)->rd_smgr); \
|
||||
Assert((relation)->rd_smgr == NULL); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* RELATION_IS_LOCAL
|
||||
* If a rel is either temp or newly created in the current transaction,
|
||||
|
||||
Reference in New Issue
Block a user