Does PostgreSQL keep its pl* interpreters loaded p

2019-02-19 02:34发布

问题:

If I wrote something in plperlu, when would that module be reloaded? Every time the function ran? The first time it ran? Does the Perl DLL get unloaded if it hasn't been used in a while, and then after that it'd be another module reload?

回答1:

I think the module will be loaded once for each server process (i.e. new session / connection) on the first use of that language within that session.

You can preload them to avoid any delay on first use, per the manual for shared_preload_libraries and local_preload_libraries.

Old PostgreSQL versions just had a single preload_libraries setting; see the manual for your version if you're on something very old.