ajbool 0.0.1

This Release
ajbool 0.0.1
Date
Status
Stable
Latest Stable
ajbool 0.0.3 —
Other Releases
Abstract
Three valued boolean with pseudo-NULL for primary keys
Description
There are times you want a boolean value for a primary key but you want NULL/Unknown to be a single, distinct value. The ajbool extension does this by marking unknown as a not null state for the purpose of this data type (but casts to bool as a true null).
Released By
einhverfr
License
PostgreSQL
Resources
Special Files

Extensions

ajbool 0.0.1
Three-valued boolean with pseudo-NULL for primary keys

README

Contents

ajbool

A special boolean type that allows 'unknown' state without beeing NULL. The intent is to allow a triple boolean value that can be used as PRIMARY key. Expected intput is 't', 'f', 'u' for true, false and unknown. Note ajbool can still be set to NULL if needed.

usage

Typecast

``` SELECT true::ajbool, false::ajbool, NULL::bool::ajbool; ajbool | ajbool | ajbool --------+--------+-------- t | f | u (1 row)

SELECT 't'::ajbool::bool, 'f'::ajbool::bool, 'u'::ajbool::bool; bool | bool | bool ------+------+------ t | f | NULL ```