pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Stark <gsstark@mit.edu>
To: Simon Riggs <simon@2ndquadrant.com>
Cc: 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 10:26:30 +0100
Message-ID: <407d949e0907070226p723915c1u8c74a64b4d66593@mail.gmail.com> (raw)
In-Reply-To: <1246958222.3874.129.camel@ebony.2ndQuadrant>
References: <71F491F5DA99604A80DE49424BF3D02B0C089039@exchange8.actuate.com>
	<dcc563d10907062313j1f0eb27awc2bea6b3f810dc41@mail.gmail.com>
	<1246958222.3874.129.camel@ebony.2ndQuadrant>

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



view thread (5+ messages)

Message-ID: <407d949e0907070226p723915c1u8c74a64b4d66593@mail.gmail.com>
Permalink:  ../407d949e0907070226p723915c1u8c74a64b4d66593@mail.gmail.com/
Also on:    postgresql.org/message-id/407d949e0907070226p723915c1u8c74a64b4d66593@mail.gmail.com

 · 

reply

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: gsstark@mit.edu, simon@2ndquadrant.com, scott.marlowe@gmail.com, pheadland@actuate.com
  Subject: Re: Best way to simulate Booleans
  In-Reply-To: <407d949e0907070226p723915c1u8c74a64b4d66593@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