1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

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.
This commit is contained in:
Peter Eisentraut
2001-06-20 18:07:56 +00:00
parent 588463a449
commit 9b4bfbdc2c
6 changed files with 253 additions and 543 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.71 2001/06/14 01:09:22 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.72 2001/06/20 18:07:56 petere Exp $
*
*-------------------------------------------------------------------------
*/
@ -28,6 +28,7 @@
#include "catalog/catname.h"
#include "catalog/pg_shadow.h"
#include "libpq/libpq-be.h"
#include "miscadmin.h"
#include "utils/builtins.h"
#include "utils/lsyscache.h"
@ -279,6 +280,7 @@ SetCharSet()
int i;
unsigned char FromChar,
ToChar;
char ChTable[80];
for (i = 0; i < 128; i++)
{
@ -286,11 +288,17 @@ SetCharSet()
RecodeBackTable[i] = i + 128;
}
p = getenv("PG_RECODETABLE");
if (IsUnderPostmaster)
{
GetCharSetByHost(ChTable, MyProcPort->raddr.in.sin_addr.s_addr, DataDir);
p = ChTable;
}
else
p = getenv("PG_RECODETABLE");
if (p && *p != '\0')
{
map_file = (char *) malloc((strlen(DataDir) +
strlen(p) + 2) * sizeof(char));
map_file = malloc(strlen(DataDir) + strlen(p) + 2);
if (! map_file)
elog(FATAL, "out of memory");
sprintf(map_file, "%s/%s", DataDir, p);