Re: Passing current_database to BackgroundWorkerInitializeConnection

From: Andres Freund <andres(at)anarazel(dot)de>
To: Jeremy Finzel <finzelj(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Passing current_database to BackgroundWorkerInitializeConnection
Date: 2018-04-02 19:35:17
Message-ID: 20180402193517.tzbcbmn3ruvpicpg@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2018-04-02 20:02:46 fdw_startup/tuple_cost vs. parallel_startup/tuple_cost
Previous Message Jeremy Finzel 2018-04-02 19:33:54 Re: Passing current_database to BackgroundWorkerInitializeConnection