Bugfix
authorJan Wieck <JanWieck@Yahoo.com>
Thu, 14 Dec 2000 23:51:35 +0000 (23:51 +0000)
committerJan Wieck <JanWieck@Yahoo.com>
Thu, 14 Dec 2000 23:51:35 +0000 (23:51 +0000)
Trying to connect to template0 left a global referenced buffer
because the scan of pg_database wasn't ended properly before
elog(FATAL).

Jan

src/backend/utils/init/postinit.c

index 8333176e8310882ed017b699879df7522435166c..80f44d5b3874a85e252f8268fa4c1fb3a159d254 100644 (file)
@@ -115,8 +115,12 @@ ReverifyMyDatabase(const char *name)
         */
        dbform = (Form_pg_database) GETSTRUCT(tup);
        if (! dbform->datallowconn)
+       {
+               heap_endscan(pgdbscan);
+               heap_close(pgdbrel, AccessShareLock);
                elog(FATAL, "Database \"%s\" is not currently accepting connections",
                         name);
+       }
 
        /*
         * OK, we're golden.  Only other to-do item is to save the MULTIBYTE