Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Operator silently fails to enable postgis when pgaudit is enabled #167

Open
kirek007 opened this issue Jan 14, 2025 · 0 comments
Open

Comments

@kirek007
Copy link

If you want to create a new database with postgis enabled on the server that have pgaudit enabled it will rise this error:

"pq: PostGIS installation stopped: pgaudit.log is set to 'ddl'. Set pgaudit.log to 'none' before installing PostGIS. You may re-enable pgaudit after installation is complete."

The problem is that operator "is fine" with it saying that all is good, but it should also mark object as "failed to configure".

As simple solution that I could propose would be to check extension name before running create extension here:
https://github.com/movetokube/postgres-operator/blob/master/pkg/postgres/database.go#L91
And run it this way:

SET pgaudit.log = 'none';
CREATE EXTENSION IF NOT EXISTS "postgis";

This should disable pgadmin only for this session, so it's safe to use this way
I was no tracing which user is used to create extensions, but "set" command required superadmin permissions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant