aboutsummaryrefslogtreecommitdiff
path: root/src/bin/initdb/initdb.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/bin/initdb/initdb.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/bin/initdb/initdb.c')
-rw-r--r--src/bin/initdb/initdb.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index 5d8338f5ac4..e6cfc05d205 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -39,7 +39,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions taken from FreeBSD.
*
- * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.75 2005/02/22 04:38:22 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.76 2005/02/26 18:43:34 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1319,15 +1319,18 @@ setup_shadow(void)
char **line;
static char *pg_shadow_setup[] = {
/*
- * Create a trigger so that direct updates to pg_shadow will be
- * written to the flat password/group files pg_pwd and pg_group
+ * Create triggers to ensure manual updates to shared catalogs
+ * will be reflected into their "flat file" copies.
*/
- "CREATE TRIGGER pg_sync_pg_pwd "
- " AFTER INSERT OR UPDATE OR DELETE ON pg_shadow "
- " FOR EACH ROW EXECUTE PROCEDURE update_pg_pwd_and_pg_group();\n",
+ "CREATE TRIGGER pg_sync_pg_database "
+ " AFTER INSERT OR UPDATE OR DELETE ON pg_database "
+ " FOR EACH STATEMENT EXECUTE PROCEDURE flatfile_update_trigger();\n",
"CREATE TRIGGER pg_sync_pg_group "
" AFTER INSERT OR UPDATE OR DELETE ON pg_group "
- " FOR EACH ROW EXECUTE PROCEDURE update_pg_pwd_and_pg_group();\n",
+ " FOR EACH STATEMENT EXECUTE PROCEDURE flatfile_update_trigger();\n",
+ "CREATE TRIGGER pg_sync_pg_pwd "
+ " AFTER INSERT OR UPDATE OR DELETE ON pg_shadow "
+ " FOR EACH STATEMENT EXECUTE PROCEDURE flatfile_update_trigger();\n",
/*
* needs to be done before alter user, because alter user checks