Fix for removal of temp tables if last transaction was aborted.
authorBruce Momjian <[email protected]>
Fri, 2 Jul 1999 18:09:28 +0000 (18:09 +0000)
committerBruce Momjian <[email protected]>
Fri, 2 Jul 1999 18:09:28 +0000 (18:09 +0000)
src/backend/postmaster/postmaster.c
src/backend/tcop/postgres.c
src/backend/utils/cache/temprel.c

index 80accb815117b85d55d8054a44f5ebd0a2673e05..34a26a2ea8d32ac7f5033ff2314efbb9e729dff3 100644 (file)
@@ -1483,8 +1483,8 @@ DoBackend(Port *port)
         * Let's clean up ourselves as the postmaster child
         */
 
-       on_exit_reset();                        /* we don't want the postmaster's
-                                                                * proc_exit() handlers */
+       /* We don't want the postmaster's proc_exit() handlers */
+       on_exit_reset();        
 
        /* ----------------
         *      register signal handlers.
index 69ea6ca5f8d484edaae015e6f6a6f24ddee152e5..a761f272cf137b686470ea1685020297c8a23ce8 100644 (file)
@@ -1483,17 +1483,6 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
                puts("\treset_client_encoding() done.");
 #endif
 
-       /* ----------------
-        * if stable main memory is assumed (-S(old) flag is set), it is necessary
-        * to flush all dirty shared buffers before exit
-        * plai 8/7/90
-        * this used to be done further down, causing an additional entry in
-        * the shmem exit list for every error :-( ... tgl 10/1/98
-        * ----------------
-        */
-       if (!TransactionFlushEnabled())
-               on_shmem_exit(FlushBufferPool, NULL);
-
        on_shmem_exit(remove_all_temp_relations, NULL);
 
        /* ----------------
@@ -1536,7 +1525,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
        if (!IsUnderPostmaster)
        {
                puts("\nPOSTGRES backend interactive interface ");
-               puts("$Revision: 1.118 $ $Date: 1999/05/29 10:25:30 $\n");
+               puts("$Revision: 1.119 $ $Date: 1999/07/02 18:09:27 $\n");
        }
 
        /* ----------------
index 551383a9caa503e50d18ddf216d532f23a3e9d8a..834028ff01e1a1dfe1354bd90360fbf79e3ca3dd 100644 (file)
@@ -30,6 +30,7 @@
 #include "nodes/pg_list.h"
 #include "utils/mcxt.h"
 #include "utils/temprel.h"
+#include "access/xact.h"
 #include "access/htup.h"
 #include "access/heapam.h"
 #include "catalog/heap.h"
@@ -79,6 +80,8 @@ remove_all_temp_relations(void)
        List       *l,
                           *next;
 
+       StartTransactionCommand();
+
        l = temp_rels;
        while (l != NIL)
        {
@@ -102,6 +105,7 @@ remove_all_temp_relations(void)
 
                l = next;
        }
+       CommitTransactionCommand();
 }
 
 /* we don't have the relname for indexes, so we just pass the oid */