Re: Passing current_database to BackgroundWorkerInitializeConnection - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Passing current_database to BackgroundWorkerInitializeConnection
Date
Msg-id 20180402193517.tzbcbmn3ruvpicpg@alap3.anarazel.de
Whole thread Raw
In response to Re: Passing current_database to BackgroundWorkerInitializeConnection  (Jeremy Finzel <finzelj@gmail.com>)
List pgsql-hackers
Hi,

On 2018-04-02 14:33:54 -0500, Jeremy Finzel wrote:
> Hmmm... not sure if I follow.  My goal is to run a SQL statement every 10
> seconds (or what value is chosen) in a particular database, using a
> background worker.  Those are the two arguments.  Am I missing some way to
> implement this apart from passing those 2 arguments into the launcher
> function?  Is the way to do this properly then to allocate shared memory
> for it, as opposed to trying to pass args into the main function?

Yes, that's the proper way. Allocate shared memory and pass a pointer to
that as the argument.

Greetings,

Andres Freund


pgsql-hackers by date:

Previous
From: Jeremy Finzel
Date:
Subject: Re: Passing current_database to BackgroundWorkerInitializeConnection
Next
From: Robert Haas
Date:
Subject: fdw_startup/tuple_cost vs. parallel_startup/tuple_cost