restore fails when postgis and pgaudit both exist
We are running dblab engine via the AWS marketplace cloudformation offering, v3.4.0-aws-1.
We are trying to replicate an existing RDS postgres database, v15.2.
The database has both the postgis and pgaudit extensions enabled.
When we run the replication, during restore, it errors with this error:
ERROR: PostGIS installation stopped: pgaudit.log is set to 'ALL'. Set pgaudit.log to 'none' before installing PostGIS. You may re-enable pgaudit after installation is complete.
We have tried all manner of approaches to setting the pgaudit.log
accordingly, but nothing is working. For example, if we add it to the queryPreprocessing.inline
setting, we see this in the logs:
2023/10/25 23:36:41 dump.go:554: [DEBUG] Postgres has been started
2023/10/25 23:36:41 preprocessor.go:199: [INFO] Run psql command [psql -U postgres -d postgres -c CREATE EXTENSION IF NOT EXISTS pgaudit; SET pgaudit.log = 'none'; CREATE EXTENSION IF NOT EXISTS postgis;]
2023/10/25 23:36:42 preprocessor.go:187: [INFO] Inline SQL has been successfully executed CREATE EXTENSION
SET
CREATE EXTENSION
2023/10/25 23:36:42 restore.go:504: [INFO] TOC file not found: stat /var/lib/dblab/dblab_pool/dataset_1/dump/toc.dat: no such file or directory. Skip directory: /var/lib/dblab/dblab_pool/dataset_1/dump/
2023/10/25 23:36:42 restore.go:455: [INFO] Directory dump not found in "/var/lib/dblab/dblab_pool/dataset_1/dump/"
2023/10/25 23:36:42 restore.go:463: [DEBUG] Explore: apolloag
2023/10/25 23:36:42 restore.go:508: [INFO] TOC file has been found: "/var/lib/dblab/dblab_pool/dataset_1/dump/apolloag/toc.dat"
2023/10/25 23:36:42 restore.go:391: [INFO] Extract database name: pg_restore --list /var/lib/dblab/dblab_pool/dataset_1/dump/apolloag | grep dbname: | tr -d '[;]'
2023/10/25 23:36:42 restore.go:476: [INFO] Found the directory dump: apolloag
2023/10/25 23:36:42 restore.go:262: [DEBUG] Database List to restore: map[apolloag:{[] [] directory apolloag}]
2023/10/25 23:36:42 restore.go:556: [INFO] Running preparatory command to create list file for apolloag [bash -c pg_restore -l /var/lib/dblab/dblab_pool/dataset_1/dump/apolloag | grep -v POLICY > /var/lib/dblab/dblab_pool/dataset_1/dump/apolloag/apolloag-list-file939273937]
2023/10/25 23:36:42 restore.go:572: [INFO] Running restore command for apolloag [pg_restore --username postgres --dbname postgres --create --jobs 1 /var/lib/dblab/dblab_pool/dataset_1/dump/apolloag --use-list=/var/lib/dblab/dblab_pool/dataset_1/dump/apolloag/apolloag-list-file939273937 --no-tablespaces --no-privileges --no-owner --exit-on-error]
2023/10/25 23:36:42 restore.go:581: [ERROR] Restore command failed: pg_restore: error: could not execute query: ERROR: PostGIS installation stopped: pgaudit.log is set to 'ALL'. Set pgaudit.log to 'none' before installing PostGIS. You may re-enable pgaudit after installation is complete.
CONTEXT: PL/pgSQL function inline_code_block line 9 at RAISE
Command was: CREATE EXTENSION IF NOT EXISTS postgis WITH SCHEMA public;