kartoza / docker-postgis

Dockerfile for postgis
GNU General Public License v2.0
657 stars 316 forks source link

add pgaudit extension #385

Closed npltr62 closed 2 years ago

npltr62 commented 2 years ago

I added pg_audit extension by a script but when i run sql cmd "CREATE EXTENSION pgaudit;" i had an error "pgaudit must be loaded via shared_preload_libraries' . What should i do first?

NyakudyaA commented 2 years ago

https://github.com/kartoza/docker-postgis#shared-preload-libraries

npltr62 commented 2 years ago

ok but when i restart the container with "SHARED_PRELOAD_LIBRARIES='pgaudit'" i have "could not access file "pgaudit": No such file or directory"

NyakudyaA commented 2 years ago

You need to run the following together

SHARED_PRELOAD_LIBRARIES='pg_cron,pgaduti'
POSTGRES_MULTIPLE_EXTENSIONS=postgis,hstore,postgis_topology,postgis_raster,pgrouting,pgaudit`

This will make sure that the extension gets created before we proceed to the loading of shared libraries.