Return-Path: postarch
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA02727; Tue, 4 Feb 92 19:39:07 -0800
Message-Id: <9202050339.AA02727@postgres.Berkeley.EDU>
From: postarch (Postgres Mailing Archive)
Subject: Re: booleans
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu
Reply-To: mer@postgres.berkeley.edu
In-Reply-To: Your message of "Tue, 04 Feb 92 10:57:52 PST."
             <9202041857.AA24498@postgres.Berkeley.EDU> 
Date: Tue, 04 Feb 92 19:38:57 PST

you write:
> 
> how are booleans supposed to be handled?
> 
> i tried something like this, but doesn't work as i'd expect:
> 
> Go 
> * create foo (name=text,locked=bool)\g
> 
> Query sent to backend is "create foo (name=text,locked=bool)"
> CREATE
> Go 
> * append foo (name="myname",locked=0::bool)\g

Boolean input must be the character t or a string where the first letter
is t for true.  Any other character or string for false:

	append foo (name = "myname", locked = 'f')\g

A Note for the future...

I have made the input function a little more forgiving....It will accept
't', and 'T' and subsequently "true", "TRUE" and any other string beggining
with a [tT].

> *  retrieve (foo.all) where locked \g
> 
> Query sent to backend is "retrieve (foo.all) where locked "
> -----------------------------
> | name        | locked      |
> -----------------------------
> | myname      | f           |
> -----------------------------
> | myname      | f           |
> -----------------------------

Try:

	retrieve (foo.all) where foo.locked = "t"::bool

> Go 
> *  retrieve (foo.all) where not locked \g
> 
> Query sent to backend is "retrieve (foo.all) where not locked "
> WARN:Feb  4 12:57:23:error : bogus integer

Try:

	retrieve (foo.all) where foo.locked = "f"::bool


Jeff Meredith
mer@postgres.berkeley.edu
