I’ve been trying to get the WorkerSpi sample working on a Windows installation, VS 2015, x64. So far, the following problems.
1. Does not compile OOB. Added the following lines.
PGDLLEXPORT void _PG_init(void);
PGDLLEXPORT Datum worker_spi_launch(PG_FUNCTION_ARGS);
PGDLLEXPORT void worker_spi_main(Datum);
2. Two warnings about int usage. Ignored.
3. Documentation is a bit light on, but copying the control file into the right folder makes the extension visible.
4. Extension installs but does nothing. No log messages. No schema. No table.
The variable worker_spi.naptime appears in pg_settings but worker_spi.total_workers does not.
5. Extension uninstalls without error, but does not release the DLL.
6. Tried to restart server with pg_ctl but it does nothing. No error, no log message, nada. [Is this a known problem with Windows?]
7. Restarted server using Task Manager. And so back to the beginning and try again.
The worker_spi.c code contains this sequence:
DefineCustomIntVariable("worker_spi.naptime",
"Duration between each check (in seconds).",
<omitted>
if (!process_shared_preload_libraries_in_progress)
return;
DefineCustomIntVariable("worker_spi.total_workers",
"Number of workers.",
From this I deduce that process_shared_preload_libraries_in_progress was false. So this appears to be an extension that must be preloaded. That does not seem to be documented anywhere.
It would be helpful to get some suggestions about what changes would be needed to allow it to be loaded on demand.
Regards
David M Bennett FACS
Andl - A New Database Language - andl.org