From fbe3917c8b441a62e455a6a9c1bac996eba04248 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Fri, 13 Sep 2024 17:14:57 +0100 Subject: [PATCH] fix: alter role set escaping --- .../files/admin_api_scripts/pg_upgrade_scripts/common.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh index c5f0c540d..46a443054 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh @@ -258,7 +258,12 @@ begin obj->>'role', case when obj->>'database' is null then '' else format('in database %I', obj->>'database') end, rec.key, - rec.value + -- https://github.com/postgres/postgres/blob/70d1c664f4376fd3499e3b0c6888cf39b65d722b/src/bin/pg_dump/dumputils.c#L861 + case + when rec.key in ('local_preload_libraries', 'search_path', 'session_preload_libraries', 'shared_preload_libraries', 'temp_tablespaces', 'unix_socket_directories') + then rec.value + else quote_literal(rec.value) + end )); end loop; end loop;