| От | Michael Paesold |
|---|---|
| Тема | psql \set case sensitive for boolean (OFF/off) |
| Дата | |
| Msg-id | 016a01c49fca$59f2a1a0$ad01a8c0@zaphod обсуждение исходный текст |
| Ответы |
Re: psql \set case sensitive for boolean (OFF/off)
|
| Список | pgsql-patches |
psql is currently case sensitive for boolean values in \set, only "off" is regarded as off, whereas "OFF" is regarded as on. There is a comment in the code that explains, why other values than "off" are always treated as true: "for backwards compatibility, anything except "off" is taken as "true" I would recommend to make this check at least case insensitive, because a) Since SQL is case insensitive, the current behaviour is not what you would expect. b) I have stumbled over this myself (setting AUTOCOMMIT to 'OFF' and then having problems because it was on) c) I think there are other who were/will be bitten by this (recommendation on general to use --set AUTOCOMMIT=OFF...) I would change strcmp to strcasecmp in GetVariableBool in variable.c. For the other functions (VariableEquals e.g.) I cannot speak, since I don't know if the case sensitivity is needed. Patch attached. Is strcasecmp ok, or should pg_strcasecmp be used here? Best Regards, Michael Paesold
В списке pgsql-patches по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера