Skip to content

Commit 6ade943

Browse files
authored
fix: alter role set escaping (#1204)
1 parent d8e6308 commit 6ade943

File tree

1 file changed

+6
-1
lines changed
  • ansible/files/admin_api_scripts/pg_upgrade_scripts

1 file changed

+6
-1
lines changed

ansible/files/admin_api_scripts/pg_upgrade_scripts/common.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,12 @@ begin
258258
obj->>'role',
259259
case when obj->>'database' is null then '' else format('in database %I', obj->>'database') end,
260260
rec.key,
261-
rec.value
261+
-- https://github.com/postgres/postgres/blob/70d1c664f4376fd3499e3b0c6888cf39b65d722b/src/bin/pg_dump/dumputils.c#L861
262+
case
263+
when rec.key in ('local_preload_libraries', 'search_path', 'session_preload_libraries', 'shared_preload_libraries', 'temp_tablespaces', 'unix_socket_directories')
264+
then rec.value
265+
else quote_literal(rec.value)
266+
end
262267
));
263268
end loop;
264269
end loop;

0 commit comments

Comments
 (0)