From: Dirk Jagdmann <jagdmann@gmail.com>
To: Scott Marlowe <scott.marlowe@gmail.com>
Cc: Peter Headland <pheadland@actuate.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Best way to simulate Booleans
Date: Tue, 7 Jul 2009 02:05:15 -0700
Message-ID: <5d0f60990907070205u3189bd01vff17950e63159455@mail.gmail.com> (raw)
In-Reply-To: <dcc563d10907062313j1f0eb27awc2bea6b3f810dc41@mail.gmail.com>
References: <71F491F5DA99604A80DE49424BF3D02B0C089039@exchange8.actuate.com>
<dcc563d10907062313j1f0eb27awc2bea6b3f810dc41@mail.gmail.com>
> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: jagdmann@gmail.com, scott.marlowe@gmail.com, pheadland@actuate.com
Subject: Re: Best way to simulate Booleans
In-Reply-To: <5d0f60990907070205u3189bd01vff17950e63159455@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox