pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: pgsql-sql@postgresql.org
Subject: Re: Boolean and Bit
Date: Tue, 16 Jan 2001 22:01:00 -0800
Message-ID: <web-1178138@davinci.ethosmedia.com> (raw)
In-Reply-To: <3A652EF0.81863C62@heart.com.au>

Keith,

> This is a compatibility issue. While I prefer to use
> BOOLEAN, this is SQL3
> and not available on the (unfortunately must use)
> MS-SQL/MSDE platform.
> 
> My options are to use a CHAR field and re-write my code
> for "T" and "F" or
> an int field and re-write my code to use "field=0" and
> "field<>0"

Given that all the MS-SQL BIT field is, is INT1, using INT2
should not be much of a problem.  Go ahead an create a
custom type based on INT2 and add constraints to prevent any
values outside of the range of 0 and 1.

This is where the SQL92 DOMAIN (not, as far as I know,
available in PGSQL) construction would be useful in
PostgreSQL instead of TYPE (Tom?).  The problem with TYPE is
that you theoretically need to define a whole set of
operators for your TYPE, while DOMAIN is a bit simpler.

> I would like to distribute a script (SQL) file to our
> users to update
> databases to new versions... obstacles include
> BOOLEAN/BIT and the 
> inconsistent use of BLOB/MEMO/[long]varchar(4096).

Well, yes.  This is beacause BLOBs are NOT part of the SQL
standard and IMHO a bad idea relationally; thus their
implementation is entirely proprietary to the RDBMS.  The
solution is not to use BLOBs.  

> Distributing schema patches is proving troublesome across
> multiple
> platforms.

Yup.  Yer in for a world of pain, sonny.  Hope you get paid
hourly.

-Josh



view thread (5+ messages)  latest in thread

Message-ID: <web-1178138@davinci.ethosmedia.com>
Permalink:  ../web-1178138@davinci.ethosmedia.com/
Also on:    postgresql.org/message-id/web-1178138@davinci.ethosmedia.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: josh@agliodbs.com
  Subject: Re: Boolean and Bit
  In-Reply-To: <web-1178138@davinci.ethosmedia.com>
  References: <3A652EF0.81863C62@heart.com.au> <web-1178138@davinci.ethosmedia.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