[type/__postgres_conf] Compare configuration parameter names case insensitively
This commit is contained in:
parent
803367b316
commit
891c98567e
2 changed files with 4 additions and 2 deletions
|
@ -39,4 +39,5 @@ esac
|
||||||
|
|
||||||
conf_name=${__object_id:?}
|
conf_name=${__object_id:?}
|
||||||
|
|
||||||
su - "${postgres_user}" -c "psql postgres -twAc \"SELECT context FROM pg_settings WHERE name = '${conf_name}'\""
|
# NOTE: SHOW/SET are case-insentitive, so this command should also be.
|
||||||
|
su - "${postgres_user}" -c "psql postgres -twAc \"SELECT context FROM pg_settings WHERE lower(name) = lower('${conf_name}')\""
|
||||||
|
|
|
@ -42,7 +42,8 @@ if su - "${postgres_user}" -c "psql postgres -twAc 'SHOW ${conf_name}'" \
|
||||||
then
|
then
|
||||||
echo present
|
echo present
|
||||||
else
|
else
|
||||||
case $(su - "${postgres_user}" -c "psql postgres -tAwc \"SELECT CASE WHEN source = 'default' OR setting = boot_val THEN 'default' ELSE source END FROM pg_settings WHERE name = '${conf_name}'\"")
|
# NOTE: SHOW/SET are case-insentitive, so this command should also be.
|
||||||
|
case $(su - "${postgres_user}" -c "psql postgres -tAwc \"SELECT CASE WHEN source = 'default' OR setting = boot_val THEN 'default' ELSE source END FROM pg_settings WHERE lower(name) = lower('${conf_name}')\"")
|
||||||
in
|
in
|
||||||
('')
|
('')
|
||||||
# invalid configuration parameter
|
# invalid configuration parameter
|
||||||
|
|
Loading…
Reference in a new issue