Re: Best way to simulate Booleans - Mailing list pgsql-sql

From Greg Stark
Subject Re: Best way to simulate Booleans
Date
Msg-id 407d949e0907070226p723915c1u8c74a64b4d66593@mail.gmail.com
Whole thread Raw
In response to Re: Best way to simulate Booleans  (Simon Riggs <simon@2ndQuadrant.com>)
List 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 by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Best way to simulate Booleans
Next
From: "Jon Norman"
Date:
Subject: Re: fsync and Windows XP