Re: 0/1 vs true/false

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: 0/1 vs true/false
Дата
Msg-id 12960.1058971411@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: 0/1 vs true/false  (Jean-Christian Imbeault <jc@mega-bucks.co.jp>)
Ответы Re: 0/1 vs true/false  (Peter Eisentraut <peter_e@gmx.net>)
Re: 0/1 vs true/false  ("scott.marlowe" <scott.marlowe@ihs.com>)
Список pgsql-general
Jean-Christian Imbeault <jc@mega-bucks.co.jp> writes:
> Oops, I meant to say can someone point me to a ressource (SQL standard
> and section?) which states that true/false must be used for booleans :)

Well, there is no boolean type per se in SQL92.  But there is in SQL99.
I think the most relevant part of the spec is the definition of boolean
literals in section 5.3:

         <boolean literal> ::=
                TRUE
              | FALSE
              | UNKNOWN

Note that the spec only really speaks to the question of what booleans
look like when written as constants in SQL statements.  AFAICT it does
not take a position on what representations are to be used when
transferring data into or out of the database.  So using '0' or '1' as
input to a boolean field is not contrary to spec, but merely outside
the spec (and in fact we will accept those strings for boolean...)

            regards, tom lane

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

Предыдущее
От: "Claudio Lapidus"
Дата:
Сообщение: Re: 0/1 vs true/false
Следующее
От:
Дата:
Сообщение: Re: 0/1 vs true/false