mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-21 16:27:39 -06:00
Fixed an issue where users could not use pgAdmin if they did not have access to the management database. #7571
This commit is contained in:
parent
1a1734cf5c
commit
445e89576b
@ -1,6 +1,6 @@
|
||||
SELECT
|
||||
name, vartype, min_val, max_val, enumvals
|
||||
FROM
|
||||
pg_catalog.pg_settings
|
||||
pg_catalog.pg_show_all_settings()
|
||||
WHERE
|
||||
context in ('user', 'superuser');
|
||||
|
@ -1,6 +1,6 @@
|
||||
SELECT
|
||||
name, vartype, min_val, max_val, enumvals
|
||||
FROM
|
||||
pg_catalog.pg_settings
|
||||
pg_catalog.pg_show_all_settings()
|
||||
WHERE
|
||||
context in ('user', 'superuser');
|
||||
|
@ -1,6 +1,6 @@
|
||||
SELECT
|
||||
name, vartype, min_val, max_val, enumvals
|
||||
FROM
|
||||
pg_catalog.pg_settings
|
||||
pg_catalog.pg_show_all_settings()
|
||||
WHERE
|
||||
context in ('user', 'superuser');
|
||||
|
@ -1,6 +1,6 @@
|
||||
SELECT
|
||||
name, vartype, min_val, max_val, enumvals
|
||||
FROM
|
||||
pg_catalog.pg_settings
|
||||
pg_catalog.pg_show_all_settings()
|
||||
WHERE
|
||||
context in ('user', 'superuser');
|
||||
|
@ -1,6 +1,6 @@
|
||||
SELECT
|
||||
name, vartype, min_val, max_val, enumvals
|
||||
FROM
|
||||
pg_catalog.pg_settings
|
||||
pg_catalog.pg_show_all_settings()
|
||||
WHERE
|
||||
context in ('user', 'superuser');
|
||||
|
@ -1,6 +1,6 @@
|
||||
SELECT
|
||||
name, vartype, min_val, max_val, enumvals
|
||||
FROM
|
||||
pg_catalog.pg_settings
|
||||
pg_catalog.pg_show_all_settings()
|
||||
WHERE
|
||||
context in ('user', 'superuser');
|
||||
|
@ -49,7 +49,7 @@ SELECT rel.oid, rel.relname AS name, rel.reltablespace AS spcoid,rel.relacl AS r
|
||||
substring(pg_catalog.array_to_string(tst.reloptions, ',') FROM 'autovacuum_freeze_table_age=([0-9]*)') AS toast_autovacuum_freeze_table_age,
|
||||
rel.reloptions AS reloptions, tst.reloptions AS toast_reloptions, rel.reloftype, typ.typname,
|
||||
typ.typrelid AS typoid, am.amname,
|
||||
(SELECT st.setting from pg_catalog.pg_settings st WHERE st.name = 'default_table_access_method') as default_amname,
|
||||
(SELECT st.setting from pg_catalog.pg_show_all_settings() st WHERE st.name = 'default_table_access_method') as default_amname,
|
||||
(CASE WHEN rel.reltoastrelid = 0 THEN false ELSE true END) AS hastoasttable,
|
||||
(SELECT pg_catalog.array_agg(provider || '=' || label) FROM pg_catalog.pg_seclabels sl1 WHERE sl1.objoid=rel.oid AND sl1.objsubid=0) AS seclabels,
|
||||
(CASE WHEN rel.oid <= {{ datlastsysoid}}::oid THEN true ElSE false END) AS is_sys_table,
|
||||
|
@ -49,7 +49,7 @@ SELECT rel.oid, rel.relname AS name, rel.reltablespace AS spcoid,rel.relacl AS r
|
||||
substring(pg_catalog.array_to_string(tst.reloptions, ',') FROM 'autovacuum_freeze_table_age=([0-9]*)') AS toast_autovacuum_freeze_table_age,
|
||||
rel.reloptions AS reloptions, tst.reloptions AS toast_reloptions, rel.reloftype, typ.typname,
|
||||
typ.typrelid AS typoid, am.amname,
|
||||
(SELECT st.setting from pg_catalog.pg_settings st WHERE st.name = 'default_table_access_method') as default_amname,
|
||||
(SELECT st.setting from pg_catalog.pg_show_all_settings() st WHERE st.name = 'default_table_access_method') as default_amname,
|
||||
(CASE WHEN rel.reltoastrelid = 0 THEN false ELSE true END) AS hastoasttable,
|
||||
(SELECT pg_catalog.array_agg(provider || '=' || label) FROM pg_catalog.pg_seclabels sl1 WHERE sl1.objoid=rel.oid AND sl1.objsubid=0) AS seclabels,
|
||||
(CASE WHEN rel.oid <= {{ datlastsysoid}}::oid THEN true ElSE false END) AS is_sys_table,
|
||||
|
@ -32,7 +32,7 @@ SELECT rel.oid, rel.relname AS name, rel.reltablespace AS spcoid,rel.relacl AS r
|
||||
JOIN pg_catalog.pg_namespace n ON n.oid=c.relnamespace
|
||||
WHERE i.inhrelid = rel.oid) AS inherited_tables_cnt,
|
||||
(CASE WHEN rel.relpersistence = 'u' THEN true ELSE false END) AS relpersistence,
|
||||
(SELECT st.setting from pg_catalog.pg_settings st WHERE st.name = 'default_table_access_method') as default_amname,
|
||||
(SELECT st.setting from pg_catalog.pg_show_all_settings() st WHERE st.name = 'default_table_access_method') as default_amname,
|
||||
substring(pg_catalog.array_to_string(rel.reloptions, ',') FROM 'fillfactor=([0-9]*)') AS fillfactor,
|
||||
substring(pg_catalog.array_to_string(rel.reloptions, ',') FROM 'parallel_workers=([0-9]*)') AS parallel_workers,
|
||||
substring(pg_catalog.array_to_string(rel.reloptions, ',') FROM 'toast_tuple_target=([0-9]*)') AS toast_tuple_target,
|
||||
|
@ -1,2 +1,2 @@
|
||||
{# ============= Fetch list of default values for autovacuum parameters =============== #}
|
||||
SELECT name, setting::numeric AS setting FROM pg_catalog.pg_settings WHERE name IN({{ columns }}) ORDER BY name
|
||||
SELECT name, setting::numeric AS setting FROM pg_catalog.pg_show_all_settings() WHERE name IN({{ columns }}) ORDER BY name
|
||||
|
@ -11,7 +11,7 @@ SELECT
|
||||
JOIN pg_catalog.pg_tablespace sp ON dtb.dattablespace=sp.oid
|
||||
WHERE dtb.oid = {{ did }}::oid)
|
||||
END as spcname,
|
||||
(SELECT st.setting from pg_catalog.pg_settings st
|
||||
(SELECT st.setting from pg_catalog.pg_show_all_settings() st
|
||||
WHERE st.name = 'default_table_access_method') as default_amname,
|
||||
c.relacl,
|
||||
nsp.nspname as schema,
|
||||
|
@ -11,7 +11,7 @@ SELECT
|
||||
JOIN pg_catalog.pg_tablespace sp ON dtb.dattablespace=sp.oid
|
||||
WHERE dtb.oid = {{ did }}::oid)
|
||||
END as spcname,
|
||||
(SELECT st.setting from pg_catalog.pg_settings st
|
||||
(SELECT st.setting from pg_catalog.pg_show_all_settings() st
|
||||
WHERE st.name = 'default_table_access_method') as default_amname,
|
||||
c.relacl,
|
||||
nsp.nspname as schema,
|
||||
|
@ -1,2 +1,2 @@
|
||||
SELECT name, vartype, min_val, max_val, enumvals
|
||||
FROM pg_catalog.pg_settings WHERE context in ('user', 'superuser')
|
||||
FROM pg_catalog.pg_show_all_settings() WHERE context in ('user', 'superuser')
|
||||
|
@ -1261,7 +1261,7 @@ SELECT
|
||||
name, vartype, min_val::numeric AS min_val, max_val::numeric AS max_val,
|
||||
enumvals
|
||||
FROM
|
||||
pg_settings
|
||||
pg_show_all_settings()
|
||||
WHERE
|
||||
context in ('user', 'superuser')
|
||||
) a""")
|
||||
|
@ -1,4 +1,4 @@
|
||||
{### SQL to fetch tablespace object options ###}
|
||||
SELECT name, vartype, min_val, max_val, enumvals
|
||||
FROM pg_catalog.pg_settings
|
||||
FROM pg_catalog.pg_show_all_settings()
|
||||
WHERE name IN ('seq_page_cost', 'random_page_cost', 'effective_io_concurrency');
|
||||
|
@ -6,6 +6,6 @@ SELECT
|
||||
unit,
|
||||
short_desc
|
||||
FROM
|
||||
pg_catalog.pg_settings
|
||||
pg_catalog.pg_show_all_settings()
|
||||
ORDER BY
|
||||
category
|
||||
|
@ -515,7 +515,8 @@ class Connection(BaseConnection):
|
||||
cur,
|
||||
"SET DateStyle=ISO; "
|
||||
"SET client_min_messages=notice; "
|
||||
"SELECT set_config('bytea_output','hex',false) FROM pg_settings"
|
||||
"SELECT set_config('bytea_output','hex',false)"
|
||||
" FROM pg_show_all_settings()"
|
||||
" WHERE name = 'bytea_output'; "
|
||||
"SET client_encoding='{0}';".format(postgres_encoding)
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user