]> 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:40 +0000 (01:19 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 18 Nov 2004 01:19:40 +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 bc34adfcf37e0afeb2545d92bb11d0aec7a78b15..63fc6a1a3ecec502b79a20166de3011a5e96a01e 100644 (file)
@@ -9,7 +9,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.124 2003/09/29 00:05:24 petere Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.124.2.1 2004/11/18 01:19:40 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -757,6 +757,14 @@ AlterDatabaseSet(AlterDatabaseSetStmt *stmt)
 
        systable_endscan(scan);
        heap_close(rel, RowExclusiveLock);
+
+       /*
+        * Force dirty buffers out to disk, so that newly-connecting backends
+        * will see the updated database in pg_database right away.  (They'll
+        * see an uncommitted tuple, but they don't care; see
+        * GetRawDatabaseInfo.)
+        */
+       BufferSync();
 }