Re: [CLSQL-Help] inserting FALSE
bsd1628 <[email protected]> Thu, 11 May 2006 14:18:00 -0400
| Newsgroups | gmane.lisp.clsql.devel |
|---|---|
| Message-ID | <[email protected]> |
Kevin Rosenberg wrote:
> bsd1628 wrote:
>> FWIW, there is no boolean type for tables in the Oracle relational
>> model. An attribute value either exists or it does not. The concept of
>> boolean value exists at the programmatic level in PL/SQL.
>
> Thanks for the info. Yet another complication to creating a model to
> well-supporting booleans on all backends. As another example, MySQL has a
> boolean type which is identical to a TINYINT (8-bit signed number)
> whereas postgresql seems to be only to (maybe?) have a 'real' boolean
> type. IIRC, postgresql acts like a CHAR(1) with storing 't' and 'f',
> but like MySQL, can use a boolean field (like active_row) in a WHERE clause
> "SELECT rowid FROM FOO WHERE active_row"
>
> Kevin
>
>
C. J. Date states in his "Introduction to Database Systems, Sixth Ed.":
"...It seems to this writer that nulls and 3VL undermine the entire
foundation of the relational model."
He goes on to recommend:
"Our recommendation to DBMS users would thus be to ignore the vendor's
3VL support entirely, and to use a disciplined "default values" scheme
(thereby staying firmly in two-valued logic)."
Please refer to chapters 5 and 20 of the above volume for more in-depth
information.
If I understand him correctly, perhaps a way to deal with boolean values
would be to treat them identically across backends, that is, use some
kind of base integer or character field to store the value NOT NULL.
Then when processing a value translate (t nil) <--> ('t', 'f'), nulls
not allowed.
As you well stated, a row is either active or inactive but not non-existent.
RC