Thread: How to session_preload_libraries multiple libraries inpostgresql.conf

How to session_preload_libraries multiple libraries inpostgresql.conf

From
Stephen Froehlich
Date:

I’m no at all sure the syntax in postgresql.conf that one uses to put multiple libraries in session_preload_libraries.

 

Right now I have the following in my postgresql.conf:

session_preload_libraries = 'pgcrypto'

session_preload_libraries = 'auto_explain'

session_preload_libraries = 'tablefunc'

 

auto_explain.log_min_duration = '3s'

 

but auto_explain doesn’t seem to be appearing in the log unless I load it manually in a session … what am I doing wrong here?

 

Thanks,

Stephen

Re: How to session_preload_libraries multiple libraries in postgresql.conf

From
Payal Singh
Date:
On Wed, Dec 13, 2017 at 2:24 PM, Stephen Froehlich <s.froehlich@cablelabs.com> wrote:

I’m no at all sure the syntax in postgresql.conf that one uses to put multiple libraries in session_preload_libraries.

 

Right now I have the following in my postgresql.conf:

session_preload_libraries = 'pgcrypto'

session_preload_libraries = 'auto_explain'

session_preload_libraries = 'tablefunc'

 

auto_explain.log_min_duration = '3s'

 

but auto_explain doesn’t seem to be appearing in the log unless I load it manually in a session … what am I doing wrong here?

 

Thanks,

Stephen


Its just same as shared_preload_libraries. Both take in a string as parameter, so can use a comma to separate the libraries:

session_preload_libraries = 'pgcrypto , auto_explain , tablefunc' 

Payal Singh,
Database Administrator,
OmniTI Computer Consulting Inc.
Phone: 240.646.0770 x 253

Re: How to session_preload_libraries multiple libraries in postgresql.conf

From
Tom Lane
Date:
Stephen Froehlich <s.froehlich@cablelabs.com> writes:
> Right now I have the following in my postgresql.conf:
> session_preload_libraries = 'pgcrypto'
> session_preload_libraries = 'auto_explain'
> session_preload_libraries = 'tablefunc'

Only the last one is going to take effect.  What you need here is
just one assignment of the parameter:

session_preload_libraries = 'pgcrypto, auto_explain, tablefunc'

            regards, tom lane