before we attempt any file deletions in ShutdownPostgres. Per Tatsuo.
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/storage/buffer/localbuf.c,v 1.62 2005/01/10 20:02:21 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/storage/buffer/localbuf.c,v 1.62.4.1 2005/03/18 16:16:20 tgl Exp $
*
*-------------------------------------------------------------------------
*/
}
#endif
}
+
+/*
+ * AtProcExit_LocalBuffers - ensure we have dropped pins during backend exit.
+ *
+ * This is just like AtProcExit_Buffers, but for local buffers. We have
+ * to drop pins to ensure that any attempt to drop temp files doesn't
+ * fail in DropRelFileNodeBuffers.
+ */
+void
+AtProcExit_LocalBuffers(void)
+{
+ /* just zero the refcounts ... */
+ MemSet(LocalRefCount, 0, NLocBuffer * sizeof(*LocalRefCount));
+}
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/init/postinit.c,v 1.139.4.1 2005/03/18 05:24:24 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/init/postinit.c,v 1.139.4.2 2005/03/18 16:16:20 tgl Exp $
*
*
*-------------------------------------------------------------------------
*/
LWLockReleaseAll();
AtProcExit_Buffers();
+ AtProcExit_LocalBuffers();
/*
* In case a transaction is open, delete any files it created. This
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/storage/bufmgr.h,v 1.89 2004/12/31 22:03:42 pgsql Exp $
+ * $PostgreSQL: pgsql/src/include/storage/bufmgr.h,v 1.89.4.1 2005/03/18 16:16:20 tgl Exp $
*
*-------------------------------------------------------------------------
*/
extern int BufferSync(int percent, int maxpages);
extern void InitLocalBuffer(void);
+extern void AtProcExit_LocalBuffers(void);
#endif