1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-26 01:22:12 +03:00

Add missing PGDLLEXPORT markings in contrib/pg_prewarm.

After commit 089480c07, it's necessary for background worker entry
points to be marked PGDLLEXPORT, else they aren't findable by
LookupBackgroundWorkerFunction().  Since pg_prewarm lacks any
regression tests, it's not surprising its worker entry points were
overlooked.  (A quick search turned up no other such oversights.)

I added some documentation pointing out the need for this, too.

Robins Tharakan and Tom Lane

CAEP4nAzndnQv3-1QKb=D-hLoK3Rko12HHMFHHtdj2GQAUXO3gw@mail.gmail.com
This commit is contained in:
Tom Lane
2022-07-27 12:00:10 -04:00
parent a2e97cb2b6
commit 03361a368e
2 changed files with 8 additions and 7 deletions

View File

@ -82,8 +82,8 @@ typedef struct AutoPrewarmSharedState
int prewarmed_blocks; int prewarmed_blocks;
} AutoPrewarmSharedState; } AutoPrewarmSharedState;
void autoprewarm_main(Datum main_arg); PGDLLEXPORT void autoprewarm_main(Datum main_arg);
void autoprewarm_database_main(Datum main_arg); PGDLLEXPORT void autoprewarm_database_main(Datum main_arg);
PG_FUNCTION_INFO_V1(autoprewarm_start_worker); PG_FUNCTION_INFO_V1(autoprewarm_start_worker);
PG_FUNCTION_INFO_V1(autoprewarm_dump_now); PG_FUNCTION_INFO_V1(autoprewarm_dump_now);

View File

@ -141,14 +141,15 @@ typedef struct BackgroundWorker
which the initial entry point for the background worker should be sought. which the initial entry point for the background worker should be sought.
The named library will be dynamically loaded by the worker process and The named library will be dynamically loaded by the worker process and
<structfield>bgw_function_name</structfield> will be used to identify the <structfield>bgw_function_name</structfield> will be used to identify the
function to be called. If loading a function from the core code, this must function to be called. If calling a function in the core code, this must
be set to "postgres". be set to <literal>"postgres"</literal>.
</para> </para>
<para> <para>
<structfield>bgw_function_name</structfield> is the name of a function in <structfield>bgw_function_name</structfield> is the name of the function
a dynamically loaded library which should be used as the initial entry point to use as the initial entry point for the new background worker. If
for a new background worker. this function is in a dynamically loaded library, it must be marked
<literal>PGDLLEXPORT</literal> (and not <literal>static</literal>).
</para> </para>
<para> <para>