Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit03361a3

Browse files
committed
Add missing PGDLLEXPORT markings in contrib/pg_prewarm.
After commit089480c, it's necessary for background worker entrypoints to be marked PGDLLEXPORT, else they aren't findable byLookupBackgroundWorkerFunction(). Since pg_prewarm lacks anyregression tests, it's not surprising its worker entry points wereoverlooked. (A quick search turned up no other such oversights.)I added some documentation pointing out the need for this, too.Robins Tharakan and Tom LaneCAEP4nAzndnQv3-1QKb=D-hLoK3Rko12HHMFHHtdj2GQAUXO3gw@mail.gmail.com
1 parenta2e97cb commit03361a3

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
intprewarmed_blocks;
8383
}AutoPrewarmSharedState;
8484

85-
voidautoprewarm_main(Datummain_arg);
86-
voidautoprewarm_database_main(Datummain_arg);
85+
PGDLLEXPORTvoidautoprewarm_main(Datummain_arg);
86+
PGDLLEXPORTvoidautoprewarm_database_main(Datummain_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. Ifloading a functionfrom the core code, this must
145-
be set to "postgres".
144+
function to be called. Ifcalling a functionin 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)

[8]ページ先頭

©2009-2025 Movatter.jp