diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 1999-09-24 00:25:33 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 1999-09-24 00:25:33 +0000 |
commit | e812458b273be00bde34fb74991ab4a99c24ab30 (patch) | |
tree | e7460ae5c0344782f6f6068399f6f7eab5be96f6 /src/backend/tcop/postgres.c | |
parent | ad791c1d140af97d93ee98883e2c45413d6f9836 (diff) | |
download | postgresql-e812458b273be00bde34fb74991ab4a99c24ab30.tar.gz postgresql-e812458b273be00bde34fb74991ab4a99c24ab30.zip |
Several changes here, not very related but touching some of the same files.
* Buffer refcount cleanup (per my "progress report" to pghackers, 9/22).
* Add links to backend PROC structs to sinval's array of per-backend info,
and use these links for routines that need to check the state of all
backends (rather than the slow, complicated search of the ShmemIndex
hashtable that was used before). Add databaseOID to PROC structs.
* Use this to implement an interlock that prevents DESTROY DATABASE of
a database containing running backends. (It's a little tricky to prevent
a concurrently-starting backend from getting in there, since the new
backend is not able to lock anything at the time it tries to look up
its database in pg_database. My solution is to recheck that the DB is
OK at the end of InitPostgres. It may not be a 100% solution, but it's
a lot better than no interlock at all...)
* In ALTER TABLE RENAME, flush buffers for the relation before doing the
rename of the physical files, to ensure we don't get failures later from
mdblindwrt().
* Update TRUNCATE patch so that it actually compiles against current
sources :-(.
You should do "make clean all" after pulling these changes.
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r-- | src/backend/tcop/postgres.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 3986bee47be..4947b291375 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.128 1999/08/31 04:26:40 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.129 1999/09/24 00:24:52 tgl Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -113,7 +113,22 @@ char relname[80]; /* current relation name */ /* note: these declarations had better match tcopprot.h */ DLLIMPORT sigjmp_buf Warn_restart; -bool InError; + +bool InError = true; + +/* + * Note: InError is a flag to elog() telling whether it is safe to longjmp + * back to PostgresMain. It is "false", allowing an error longjmp, during + * normal processing. It is "true" during startup, when we have not yet + * set the Warn_restart jmp_buf, and also "true" in the interval when we + * have executed a longjmp back to PostgresMain and not yet finished cleaning + * up after the error. In either case, elog(ERROR) should be treated as a + * fatal exit condition rather than attempting to recover --- since there is + * noplace to recover to in the first case, and we don't want to risk an + * infinite loop of "error recoveries" in the second case. + * + * Therefore, InError starts out "true" at program load time, as shown above. + */ extern int NBuffers; @@ -1469,7 +1484,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[]) if (!IsUnderPostmaster) { puts("\nPOSTGRES backend interactive interface "); - puts("$Revision: 1.128 $ $Date: 1999/08/31 04:26:40 $\n"); + puts("$Revision: 1.129 $ $Date: 1999/09/24 00:24:52 $\n"); } /* ---------------- @@ -1479,6 +1494,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[]) * so we abort the current transaction and start a new one. * * Note: elog(ERROR) does a siglongjmp() to transfer control here. + * See comments with the declaration of InError, above. * ---------------- */ |