From c5533f47c1fdb3d1b751383a660ea12e80f7b835 Mon Sep 17 00:00:00 2001 From: "Christian M. Adams" Date: Thu, 9 Oct 2025 15:34:47 -0400 Subject: [PATCH] Use --no-acl flag when restoring to exclude GRANT and REVOKE commands This avoids running in to the following error when pg_restore is run as the application db user from the db-management pod: pg_restore: error: could not execute query: ERROR: must be member of role postgres Command was: ALTER SCHEMA public OWNER TO postgres; --- roles/restore/tasks/postgres.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/restore/tasks/postgres.yml b/roles/restore/tasks/postgres.yml index f11fa609..8f050835 100644 --- a/roles/restore/tasks/postgres.yml +++ b/roles/restore/tasks/postgres.yml @@ -83,7 +83,7 @@ - name: Set pg_restore command set_fact: pg_restore: >- - pg_restore --clean --if-exists + pg_restore --clean --if-exists --no-owner --no-acl -U {{ awx_postgres_user }} -h {{ resolvable_db_host }} -d {{ awx_postgres_database }}