Skip to content

Commit

Permalink
Fix previous static backend config issue
Browse files Browse the repository at this point in the history
Static config is obviously not `config_sess`, and it's not
always `is_backend`. It was okay because the backend value
is just the same, but still good to make it right.
  • Loading branch information
fantix committed Dec 24, 2024
1 parent 130bea9 commit c73a0de
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions edb/pgsql/metaschema.py
Original file line number Diff line number Diff line change
Expand Up @@ -3581,6 +3581,23 @@ class SysConfigFullFunction(trampoline.VersionedFunction):
SELECT * FROM config_defaults WHERE name like '%::%'
),
config_static AS (
SELECT
s.name AS name,
s.value AS value,
(CASE
WHEN s.type = 'A' THEN 'command line'
WHEN s.type = 'E' THEN 'environment variable'
ELSE 'configuration file' -- 'F', matches WHERE below
END) AS source,
config_spec.backend_setting IS NOT NULL AS is_backend
FROM
_edgecon_state s
INNER JOIN config_spec ON (config_spec.name = s.name)
WHERE
s.type = 'A' OR s.type = 'E' OR s.type = 'F'
),
config_sys AS (
SELECT
s.key AS name,
Expand Down Expand Up @@ -3611,17 +3628,12 @@ class SysConfigFullFunction(trampoline.VersionedFunction):
SELECT
s.name AS name,
s.value AS value,
(CASE
WHEN s.type = 'A' THEN 'command line'
WHEN s.type = 'E' THEN 'environment variable'
WHEN s.type = 'F' THEN 'configuration file'
ELSE 'session'
END) AS source,
FALSE AS from_backend -- only 'B' is for backend settings
'session' AS source,
FALSE AS is_backend -- only 'B' is for backend settings
FROM
_edgecon_state s
WHERE
s.type != 'B'
s.type = 'C'
),
pg_db_setting AS (
Expand Down Expand Up @@ -3791,6 +3803,7 @@ class SysConfigFullFunction(trampoline.VersionedFunction):
FROM
(
SELECT * FROM config_defaults UNION ALL
SELECT * FROM config_static UNION ALL
SELECT * FROM config_sys UNION ALL
SELECT * FROM config_db UNION ALL
SELECT * FROM config_sess
Expand Down

0 comments on commit c73a0de

Please sign in to comment.