]> granicus.if.org Git - postgresql/commitdiff
Back-patch fix for ALTER DATABASE failing to flush pg_database changes
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 18 Nov 2004 01:19:57 +0000 (01:19 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 18 Nov 2004 01:19:57 +0000 (01:19 +0000)
to disk right away.  This is just a one-liner change rather than trying
to use FlushRelationBuffers().

src/backend/commands/dbcommands.c

index 79fd2fe97f05447ac8f7a6c942c26affce50397f..400a244ecf338a8d2f97863e18a6849906e03993 100644 (file)
@@ -9,7 +9,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.107.2.1 2002/12/02 05:21:01 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.107.2.2 2004/11/18 01:19:57 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -575,6 +575,14 @@ AlterDatabaseSet(AlterDatabaseSetStmt *stmt)
 
        heap_endscan(scan);
        heap_close(rel, RowExclusiveLock);
+
+       /*
+        * Force dirty buffers out to disk, so that newly-connecting backends
+        * will see the altered database tuple in pg_database right away.
+        * (They'll see an uncommitted deletion, but they don't care; see
+        * GetRawDatabaseInfo.)
+        */
+       BufferSync();
 }