Re: Best way to simulate Booleans

Поиск
Список
Период
Сортировка
От Dirk Jagdmann
Тема Re: Best way to simulate Booleans
Дата
Msg-id 5d0f60990907070205u3189bd01vff17950e63159455@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Best way to simulate Booleans  (Scott Marlowe <scott.marlowe@gmail.com>)
Список pgsql-sql
> The most transportable method would be to use either a char(1) or an
> int with a check constraint.
>
> mybool char(1) check (mybool in ('t','f'))
> mybool int check (mybool >=0 and <=1)

I would decide depending on the application requirement. If my Oracle
should look similar to PostgreSQL use the char(1). If you have lots of
application code the int is probably better, since you can just use
the created programming language variable (presumably an integer as
well) in your programming language expressions (if, while).

-- 
---> Dirk Jagdmann
----> http://cubic.org/~doj
-----> http://llg.cubic.org


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

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: Best way to simulate Booleans
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Best way to simulate Booleans