Re: IsUnderPostmaster with shared_preload_libraries on Windows

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: IsUnderPostmaster with shared_preload_libraries on Windows
Date: 2016-06-13 20:57:01
Message-ID: 20815.1465851421@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Joe Conway <mail(at)joeconway(dot)com> writes:
> Is it expected that IsUnderPostmaster is true during postmaster startup
> in an extension's _PG_init() when preloading under Windows? On Linux it
> is false at this point AFAICT.

AFAIK it will be false in the *postmaster's* execution of _PG_init().
But keep in mind that on Windows each exec'd child process will have to
load the shared_preload_libraries again for itself, and those executions
should see IsUnderPostmaster = true. I think what you are seeing is
additional executions in the startup process or other background
processes, which don't happen in a forked-children environment.

You can probably duplicate this behavior for testing purposes on Unix
by compiling with EXEC_BACKEND defined, if that helps.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2016-06-13 21:09:43 Re: New design for FK-based join selectivity estimation
Previous Message Tom Lane 2016-06-13 20:46:19 Re: ERROR: ORDER/GROUP BY expression not found in targetlist