Allow on/off as input texts for boolean.

Поиск
Список
Период
Сортировка
От ITAGAKI Takahiro
Тема Allow on/off as input texts for boolean.
Дата
Msg-id 20090217150947.F185.52131E4D@oss.ntt.co.jp
обсуждение исходный текст
Ответ на Questions about parsing boolean and casting to anyelement  (ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp>)
Ответы Re: Allow on/off as input texts for boolean.
Список pgsql-hackers
ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp> wrote:
>   - Postgres interprets 'on' as true and 'off' as false in configuration
>     parameters, but they are not accepted in sql-boolean.
>     Is it a design? or should we add a parser for 'on' and 'off' ?
>     I'd like to allow 'on' and 'off' in sql-boolean, too.

Here is a patch to allow 'on' and 'off' as input texts for boolean.
Duplicated boolean parsers in parse_bool() and boolin() are merged
into a new parse_bool_with_len().

I think the change is useful when we treat reloptions in programs.
Since human-readable texts are not suitable for programs, we would need
conversions from text to boolean. Then the shared parser works well.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center


Вложения

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

Предыдущее
От: KaiGai Kohei
Дата:
Сообщение: Re: SE-PostgreSQL and row level security
Следующее
От: Peter Eisentraut
Дата:
Сообщение: PL/Perl translation, croak