Logical Data Types

I l @ ve RuBoard

Logical data types are used to represent the concepts of true, false, or NULL . Typically, this data type is useful as a flag that indicates the current state of a record. The true and false values are self-explanatory, while the value NULL usually indicates the equivalent of "unknown."

BOOLEAN

Description

Holds a logical true , a logical false , or a NULL value.

Inputs

TRUE, t, true, y, yes, 1 ”All valid TRUE values.

FALSE, f, false, n, no, ”All valid FALSE values.

NULL ”Valid NULL value.

Storage Size

1 byte

Notes

Generally , it is best to use the TRUE and FALSE input forms for Boolean data. These formats are SQL compatible and generally are more accepted, although some RDBMSs use 1 and 0 for TRUE and FALSE representations. Some of the input values need to be escaped by enclosing them in single quotes (i.e., 't' ). However, the SQL-compliant TRUE and FALSE forms do not require quotations.

I l @ ve RuBoard


PostgreSQL Essential Reference
PostgreSQL Essential Reference
ISBN: 0735711216
EAN: 2147483647
Year: 2001
Pages: 118
Authors: Barry Stinson

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net