Prevent multiple archivers from starting. Backpatch to 8.1.X.
authorBruce Momjian <[email protected]>
Tue, 30 May 2006 13:31:01 +0000 (13:31 +0000)
committerBruce Momjian <[email protected]>
Tue, 30 May 2006 13:31:01 +0000 (13:31 +0000)
Simon Riggs

src/backend/catalog/pg_conversion.c
src/backend/postmaster/pgarch.c

index 3941748e681997d6cfcb157866349714378e417f..2c181bf19cc7302acbac6b92604f7d6cc248daa9 100644 (file)
@@ -18,6 +18,7 @@
 #include "catalog/dependency.h"
 #include "catalog/indexing.h"
 #include "catalog/pg_conversion.h"
+#include "catalog/pg_namespace.h"
 #include "catalog/pg_proc.h"
 #include "catalog/namespace.h"
 #include "utils/builtins.h"
@@ -124,6 +125,12 @@ ConversionCreate(const char *conname, Oid connamespace,
        recordDependencyOnOwner(ConversionRelationId, HeapTupleGetOid(tup),
                                                        conowner);
 
+       /* create dependency on namespace */
+       myself.classId = ConversionRelationId;
+       referenced.classId = NamespaceRelationId;
+       referenced.objectId = connamespace;
+       recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
+
        heap_freetuple(tup);
        heap_close(rel, RowExclusiveLock);
 
index 46eba09334f640edb390c9d145513a0c301a1bb2..e2fed0a82050b572a4cb60d6fbedfa8a363766f9 100644 (file)
@@ -352,7 +352,7 @@ pgarch_ArchiverCopyLoop(void)
         * some backend will add files onto the list of those that need archiving
         * while we are still copying earlier archives
         */
-       while (pgarch_readyXlog(xlog))
+       while (PostmasterIsAlive(true) && pgarch_readyXlog(xlog))
        {
                int                     failures = 0;