Re: InitPostgres and flatfiles question - Mailing list pgsql-hackers

From Tom Lane
Subject Re: InitPostgres and flatfiles question
Date
Msg-id 9742.1167840455@sss.pgh.pa.us
Whole thread Raw
In response to InitPostgres and flatfiles question  (Markus Schiltknecht <markus@bluegap.ch>)
Responses Re: InitPostgres and flatfiles question  (Markus Schiltknecht <markus@bluegap.ch>)
List pgsql-hackers
Markus Schiltknecht <markus@bluegap.ch> writes:
> I've just run into a race condition with creating a database and 
> connecting to it immediately afterwards. I'm getting a "database %s not 
> found" error just after the first flatfiles check in InitPostgres().

In what PG version?

> What that FindMyDatabase() there does, besides checking if the database 
> exists, is getting the database and tablespace OIDs, right? Why does the 
> postmaster not pass those instead of the database name?

Because the postmaster doesn't have direct database access.  If it did,
any corruption of shared memory would risk crashing the postmaster
along with the backends.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Rare corruption of pg_class index
Next
From: Markus Schiltknecht
Date:
Subject: Re: InitPostgres and flatfiles question