Re: Booleans - Why in Postgres and not in Oracle or Mysql?

From: "Dann Corbit" <DCorbit(at)connx(dot)com>
To: "CSN" <cool_screen_name90001(at)yahoo(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Booleans - Why in Postgres and not in Oracle or Mysql?
Date: 2005-05-05 19:21:17
Message-ID: D425483C2C5C9F49B5B7A41F89441547055B58@postal.corporate.connx.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> -----Original Message-----
> From: pgsql-general-owner(at)postgresql(dot)org [mailto:pgsql-general-
> owner(at)postgresql(dot)org] On Behalf Of CSN
> Sent: Thursday, May 05, 2005 11:57 AM
> To: pgsql-general(at)postgresql(dot)org
> Subject: [GENERAL] Booleans - Why in Postgres and not in Oracle or
Mysql?
>
> I like Postgres's boolean type -

Me too.

> why do you suppose
> neither Mysql nor Oracle has bothered to implement it?

Probably they just create a domain using a char which can take on two
values (e.g. 't'/'f' or 1/0). Oracle 10 has a bit data type (which is a
boolean for all intents and purposes):
B.1 BIGINT
B.2 BINARY
B.3 BIT
B.4 BLOB
B.5 CHAR
B.6 CLOB
B.7 DATE
B.8 DECIMAL
B.9 DOUBLE PRECISION
B.10 FLOAT
B.11 INTEGER
B.12 LONG
B.13 LONG RAW
B.14 LONG VARBINARY
B.15 LONG VARCHAR
B.16 NUMBER
B.17 NUMERIC
B.18 RAW
B.19 REAL
B.20 ROWID
B.21 SMALLINT
B.22 TIME
B.23 TIMESTAMP
B.24 TINYINT
B.25 VARBINARY
B.26 VARCHAR
B.27 VARCHAR2

MySql has a partial Boolean implementation. From
http://dev.mysql.com/doc/mysql/en/numeric-type-overview.html:

BOOL , BOOLEAN

These are synonyms for TINYINT(1). The BOOLEAN synonym was added in
MySQL 4.1.0. A value of zero is considered false. Non-zero values are
considered true.

In the future, full boolean type handling will be introduced in
accordance with standard SQL.

> Booleans are in the SQL-99 spec.

Probably, MySQL and Oracle will have Boolean types eventually with full
compatibility to the standard.

> CSN
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------(end of
broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if
your
> joining column's datatypes do not match

Browse pgsql-general by date

  From Date Subject
Next Message CSN 2005-05-05 19:28:45 Re: Booleans - Why in Postgres and not in Oracle or Mysql?
Previous Message Joshua D. Drake 2005-05-05 19:10:40 Re: Postgres vs Firebird?