Re: worker_spi.naptime in worker_spi example

From: Jeremy Finzel <finzelj(at)gmail(dot)com>
To: Chapman Flack <chap(at)anastigmatix(dot)net>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: worker_spi.naptime in worker_spi example
Date: 2018-03-15 20:19:50
Message-ID: CAMa1XUgWeYD4E=ZCLLH_huaTwB5BuuWgf9Zv9+tLDu+qxGRH=w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Mar 15, 2018 at 12:21 PM, Chapman Flack <chap(at)anastigmatix(dot)net>
wrote:

> On 03/15/2018 10:59 AM, Jeremy Finzel wrote:
>
> > WaitLatch function the same variable worker_spi_naptime without
> referencing
> > the configuration created in _PG_init. Am I missing something here?
>
> You can see the declaration of that variable up on line 56.
> It's just an int variable static to worker_spi.c.
>
> The code you saw in _PG_init registers that variable to the
> Grand Unified Configuration system (you can see where the address
> of the variable, &worker_spi_naptime, is passed in that registration),
> so the GUC system can handle setting or querying the value from SQL
> (and config files, etc.).
>
> You can read more about the GUC system in
> src/backend/utils/misc/README, src/backend/utils/misc/guc.c, and
> src/include/utils/guc.h.
>
> -Chap
>

Thank you. I did see worker_spi_naptime definition, but I wanted to
pass worker_spi_naptime
as an argument instead into worker_spi_main so that I can control via SQL
interface how frequently the worker SQL executes. Is this possible?

Thanks,
Jeremy

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chapman Flack 2018-03-15 20:54:45 Re: worker_spi.naptime in worker_spi example
Previous Message Robert Haas 2018-03-15 18:46:25 Re: [HACKERS] Partition-wise aggregation/grouping