Re: worker_spi.naptime in worker_spi example

2018-03-15 Thread Jeremy Finzel
On Thu, Mar 15, 2018 at 3:54 PM, Chapman Flack wrote: > On 03/15/2018 04:19 PM, Jeremy Finzel wrote: > > > 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 h

Re: worker_spi.naptime in worker_spi example

2018-03-15 Thread Chapman Flack
On 03/15/2018 04:19 PM, Jeremy Finzel wrote: > 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? Are you

Re: worker_spi.naptime in worker_spi example

2018-03-15 Thread Jeremy Finzel
On Thu, Mar 15, 2018 at 12:21 PM, Chapman Flack 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 tha

Re: worker_spi.naptime in worker_spi example

2018-03-15 Thread Chapman Flack
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_

worker_spi.naptime in worker_spi example

2018-03-15 Thread Jeremy Finzel
Hello! I am trying to create a background worker where I can pass in via SQL interface the naptime. I'm not sure how to do this. In the worker_spi example, _PG_init creates a configuration using the static variable worker_spi_naptime, but then it appears to call in worker_spi_main in the WaitLat