Re: Best way to simulate Booleans

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Best way to simulate Booleans
Дата
Msg-id 407d949e0907070226p723915c1u8c74a64b4d66593@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Best way to simulate Booleans  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-sql
On Tue, Jul 7, 2009 at 10:17 AM, Simon Riggs<simon@2ndquadrant.com> wrote:
>
>
> Integer works best since it converts easily to boolean
>
> mybool smallint check (mybool in (0, 1))
>
> You can use "char" also, but the syntax is less clear.

Hm, I was going to suggest using boolean in postgres and making a
"boolean" domain in Oracle for char(1) and then write all sql to
compare with = 'f' and = 't'. It's annoying you can't use "WHERE
foo_flag" and have to write "WHERE foo_flag = 't'" but otherwise that
would give you the same sql in both flavours.


-- 
greg
http://mit.edu/~gsstark/resume.pdf


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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Best way to simulate Booleans
Следующее
От: "Jon Norman"
Дата:
Сообщение: Re: fsync and Windows XP