Skip to content

Commit

Permalink
Add pg_show_all_settings to allowed pg functions (#8298)
Browse files Browse the repository at this point in the history
This is used by pgAdmin4 as of 8.12 and replaces their usage of the
table `pg_catalog.pg_settings` with `pg_catalog.pg_show_all_settings()`.

Closes #8297

See pgadmin-org/pgadmin4#7870
  • Loading branch information
scotttrinh authored and msullivan committed Feb 4, 2025
1 parent 6f6a828 commit da9b73f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions edb/pgsql/resolver/static.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ def eval_TypeCast(
'pg_last_wal_replay_lsn',
'pg_current_wal_flush_lsn',
'pg_relation_is_publishable',
'pg_show_all_settings',
}
)

Expand Down
3 changes: 2 additions & 1 deletion tests/test_sql_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,8 @@ async def test_sql_query_pgadmin_hack(self):
await self.scon.execute("SET DateStyle=ISO;")
await self.scon.execute("SET client_min_messages=notice;")
await self.scon.execute(
"SELECT set_config('bytea_output','hex',false) FROM pg_settings"
"SELECT set_config('bytea_output','hex',false)"
" FROM pg_catalog.pg_show_all_settings()"
" WHERE name = 'bytea_output'; "
)
await self.scon.execute("SET client_encoding='WIN874';")

0 comments on commit da9b73f

Please sign in to comment.