mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Use 'set_config(...)' function to update the 'bytea_output' settings
instead of 'UPDATE' statement, which is not allowed in the the read-only instances. Reported by: Robert J. Rotter Solution provided by: Tom Lane Fixes #3973
This commit is contained in:
parent
28ce485cd2
commit
eb3d3980e0
@ -406,12 +406,14 @@ class Connection(BaseConnection):
|
|||||||
# Note that we use 'UPDATE pg_settings' for setting bytea_output as a
|
# Note that we use 'UPDATE pg_settings' for setting bytea_output as a
|
||||||
# convenience hack for those running on old, unsupported versions of
|
# convenience hack for those running on old, unsupported versions of
|
||||||
# PostgreSQL 'cos we're nice like that.
|
# PostgreSQL 'cos we're nice like that.
|
||||||
status = _execute(cur, "SET DateStyle=ISO; "
|
status = _execute(
|
||||||
|
cur,
|
||||||
|
"SET DateStyle=ISO; "
|
||||||
"SET client_min_messages=notice; "
|
"SET client_min_messages=notice; "
|
||||||
"UPDATE pg_settings SET setting = 'escape'"
|
"SELECT set_config('bytea_output','escape',false) FROM pg_settings"
|
||||||
" WHERE name = 'bytea_output'; "
|
" WHERE name = 'bytea_output'; "
|
||||||
"SET client_encoding='{0}';"
|
"SET client_encoding='{0}';".format(postgres_encoding)
|
||||||
.format(postgres_encoding))
|
)
|
||||||
|
|
||||||
if status is not None:
|
if status is not None:
|
||||||
self.conn.close()
|
self.conn.close()
|
||||||
|
Loading…
Reference in New Issue
Block a user