Skip to content

Commit 03361a3

Browse files
committed
Add missing PGDLLEXPORT markings in contrib/pg_prewarm.
After commit 089480c, 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
1 parent a2e97cb commit 03361a3

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

contrib/pg_prewarm/autoprewarm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ typedef struct AutoPrewarmSharedState
8282
int prewarmed_blocks;
8383
} AutoPrewarmSharedState;
8484

85-
void autoprewarm_main(Datum main_arg);
86-
void autoprewarm_database_main(Datum main_arg);
85+
PGDLLEXPORT void autoprewarm_main(Datum main_arg);
86+
PGDLLEXPORT void autoprewarm_database_main(Datum main_arg);
8787

8888
PG_FUNCTION_INFO_V1(autoprewarm_start_worker);
8989
PG_FUNCTION_INFO_V1(autoprewarm_dump_now);

doc/src/sgml/bgworker.sgml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,15 @@ typedef struct BackgroundWorker
141141
which the initial entry point for the background worker should be sought.
142142
The named library will be dynamically loaded by the worker process and
143143
<structfield>bgw_function_name</structfield> will be used to identify the
144-
function to be called. If loading a function from the core code, this must
145-
be set to "postgres".
144+
function to be called. If calling a function in the core code, this must
145+
be set to <literal>"postgres"</literal>.
146146
</para>
147147

148148
<para>
149-
<structfield>bgw_function_name</structfield> is the name of a function in
150-
a dynamically loaded library which should be used as the initial entry point
151-
for a new background worker.
149+
<structfield>bgw_function_name</structfield> is the name of the function
150+
to use as the initial entry point for the new background worker. If
151+
this function is in a dynamically loaded library, it must be marked
152+
<literal>PGDLLEXPORT</literal> (and not <literal>static</literal>).
152153
</para>
153154

154155
<para>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy