initdb's -c option behaves wrong way?

Поиск
Список
Период
Сортировка
От Kyotaro Horiguchi
Тема initdb's -c option behaves wrong way?
Дата
Msg-id 20230928.164904.2153358973162534034.horikyota.ntt@gmail.com
обсуждение исходный текст
Ответы Re: initdb's -c option behaves wrong way?  (Daniel Gustafsson <daniel@yesql.se>)
Список pgsql-hackers
Hello.

I noticed that -c option of initdb behaves in an unexpected
manner. Identical variable names with variations in letter casing are
treated as distinct variables.

$ initdb -cwork_mem=100 -cWORK_MEM=1000 -cWork_mem=2000
...
$ grep -i 'work_mem ' $PGDATA/postgresql.conf
work_mem = 100                          # min 64kB
#maintenance_work_mem = 64MB            # min 1MB
#autovacuum_work_mem = -1               # min 1MB, or -1 to use maintenance_work_mem
#logical_decoding_work_mem = 64MB       # min 64kB
WORK_MEM = 1000
Work_mem = 2000


The original intention was apparently to overwrite the existing
line. Furthermore, I surmise that preserving the original letter
casing is preferable.

Attached is a patch to address this issue.  To retrieve the variable
name from the existing line, the code is slightly restructured.
Alternatively, should we just down-case the provided variable names?

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: jacktby jacktby
Дата:
Сообщение: Re: Set enable_seqscan doesn't take effect?
Следующее
От: Bharath Rupireddy
Дата:
Сообщение: Re: [PoC] pg_upgrade: allow to upgrade publisher node