aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2001-06-20 18:07:56 +0000
committerPeter Eisentraut <peter_e@gmx.net>2001-06-20 18:07:56 +0000
commit9b4bfbdc2cd74342d9febb74c93acad1d4de84ca (patch)
tree0239cbb8e885f8420b5ec967c928f4e6fdc5bed1 /src/backend/tcop/postgres.c
parent588463a449e70aff33d799b5c9475ab94fbdf4c9 (diff)
downloadpostgresql-9b4bfbdc2cd74342d9febb74c93acad1d4de84ca.tar.gz
postgresql-9b4bfbdc2cd74342d9febb74c93acad1d4de84ca.zip
Handle reading of startup packet and authentication exchange after forking
a new postmaster child process. This should eliminate problems with authentication blocking (e.g., ident, SSL init) and also reduce problems with the accept queue filling up under heavy load. The option to send elog output to a different file per backend (postgres -o) has been disabled for now because the initialization would have to happen in a different order and it's not clear we want to keep this anyway.
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r--src/backend/tcop/postgres.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index 2692053a39d..476c2f72c3a 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.222 2001/06/19 23:40:10 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.223 2001/06/20 18:07:55 petere Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
@@ -45,6 +45,7 @@
#include "libpq/pqformat.h"
#include "libpq/pqsignal.h"
#include "miscadmin.h"
+#include "libpq/auth.h"
#include "nodes/print.h"
#include "optimizer/cost.h"
#include "optimizer/planner.h"
@@ -1142,11 +1143,13 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
*/
if (!IsUnderPostmaster)
{
+ SetProcessingMode(InitProcessing);
EnableExceptionHandling(true);
MemoryContextInit();
}
- SetProcessingMode(InitProcessing);
+ if (IsUnderPostmaster)
+ ClientAuthentication(MyProcPort); /* might not return */
/*
* Set default values for command-line options.
@@ -1567,13 +1570,11 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
* restart... */
}
pq_init(); /* initialize libpq at backend startup */
- whereToSendOutput = Remote;
BaseInit();
}
else
{
/* interactive case: database name can be last arg on command line */
- whereToSendOutput = Debug;
if (errs || argc - optind > 1)
{
fprintf(stderr, "%s: invalid command line arguments\nTry -? for help.\n", argv[0]);
@@ -1709,7 +1710,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
if (!IsUnderPostmaster)
{
puts("\nPOSTGRES backend interactive interface ");
- puts("$Revision: 1.222 $ $Date: 2001/06/19 23:40:10 $\n");
+ puts("$Revision: 1.223 $ $Date: 2001/06/20 18:07:55 $\n");
}
/*