aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/init/flatfiles.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-02-26 18:43:34 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-02-26 18:43:34 +0000
commit0fc4ecf93543a0e293845bdc47712285a9165aa0 (patch)
treec79e93a9d4e0a23120a1968091e69892fd1bc3ed /src/backend/utils/init/flatfiles.c
parentffef9a9de4f7d992ebfbf88e5e926bc5e022f420 (diff)
downloadpostgresql-0fc4ecf93543a0e293845bdc47712285a9165aa0.tar.gz
postgresql-0fc4ecf93543a0e293845bdc47712285a9165aa0.zip
Finish up the flat-files project: get rid of GetRawDatabaseInfo() hack
in favor of looking at the flat file copy of pg_database during backend startup. This should finally eliminate the various corner cases in which backend startup fails unexpectedly because it isn't able to distinguish live and dead tuples in pg_database. Simplify locking on pg_database to be similar to the rules used with pg_shadow and pg_group, and eliminate FlushRelationBuffers operations that were used only to reduce the odds of failure of GetRawDatabaseInfo. initdb forced due to addition of a trigger to pg_database.
Diffstat (limited to 'src/backend/utils/init/flatfiles.c')
-rw-r--r--src/backend/utils/init/flatfiles.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/src/backend/utils/init/flatfiles.c b/src/backend/utils/init/flatfiles.c
index 8968d572c88..e7ddd0a42c1 100644
--- a/src/backend/utils/init/flatfiles.c
+++ b/src/backend/utils/init/flatfiles.c
@@ -22,7 +22,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/utils/init/flatfiles.c,v 1.3 2005/02/20 22:02:19 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/init/flatfiles.c,v 1.4 2005/02/26 18:43:33 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -243,10 +243,12 @@ write_database_file(Relation drel)
Form_pg_database dbform = (Form_pg_database) GETSTRUCT(tuple);
char *datname;
Oid datoid;
+ Oid dattablespace;
TransactionId datfrozenxid;
datname = NameStr(dbform->datname);
datoid = HeapTupleGetOid(tuple);
+ dattablespace = dbform->dattablespace;
datfrozenxid = dbform->datfrozenxid;
/*
@@ -276,13 +278,13 @@ write_database_file(Relation drel)
}
/*
- * The file format is: "dbname" oid frozenxid
+ * The file format is: "dbname" oid tablespace frozenxid
*
* The xid is not needed for backend startup, but may be of use
* for forensic purposes.
*/
fputs_quote(datname, fp);
- fprintf(fp, " %u %u\n", datoid, datfrozenxid);
+ fprintf(fp, " %u %u %u\n", datoid, dattablespace, datfrozenxid);
}
heap_endscan(scan);
@@ -830,15 +832,3 @@ flatfile_update_trigger(PG_FUNCTION_ARGS)
return PointerGetDatum(NULL);
}
-
-
-/*
- * Old version of trigger --- remove after we can force an initdb
- */
-extern Datum update_pg_pwd_and_pg_group(PG_FUNCTION_ARGS);
-
-Datum
-update_pg_pwd_and_pg_group(PG_FUNCTION_ARGS)
-{
- return flatfile_update_trigger(fcinfo);
-}