Re: BackgroundWorkerInitializeConnection(NULL, ...) doesn't work - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: BackgroundWorkerInitializeConnection(NULL, ...) doesn't work
Date
Msg-id 20130810143024.GN10718@eldon.alvh.no-ip.org
Whole thread Raw
In response to BackgroundWorkerInitializeConnection(NULL, ...) doesn't work  (Andrew Tipton <andrew@kiwidrew.com>)
Responses Re: BackgroundWorkerInitializeConnection(NULL, ...) doesn't work  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Andrew Tipton wrote:

> However, should one attempt to pass NULL for the dbname parameter, the
> process will die with:
> 
> FATAL: database 0 does not exist
> 
> BackgroundWorkerInitializeConnection() is essentially just a wrapper around
> InitPostgres(), passing it the supplied dbname and username.  (And passing
> InvalidOid for the dboid parameter.)  When InitPostgres() finds that dbname
> is null, it falls back on dboid.  GetDatabaseTupleByOid() returns NULL when
> given InvalidOid, resulting in the aforementioned elog(FATAL).

Hmm, the intention is that this code path mimics what the autovacuum
launcher does to establish its connection.  It did work at some point;
maybe I broke this before commit.  I will give it a look next week.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: proposal: lob conversion functionality
Next
From: Tom Lane
Date:
Subject: Re: BackgroundWorkerInitializeConnection(NULL, ...) doesn't work