Subject: booleans

From: [email-masked] (Alfredo Sanchez)
Date: Tue, 4 Feb 92 10:57:52 -0800

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

Query sent to backend is "append foo (name="myname",locked=0::bool)"
APPEND
Go 
*  append foo (name="myname",locked=1::bool)\g

Query sent to backend is "append foo (name="myname",locked=1::bool)"
APPEND
Go 
* retrieve (foo.all) \g

Query sent to backend is "retrieve (foo.all) "
-----------------------------
| name        | locked      |
-----------------------------
| myname      | f           |
-----------------------------
| myname      | f           |
-----------------------------

Go 
*  retrieve (foo.all) where locked \g

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

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

Go 
* 

well, i guess it works differently.
thanx again,

J Alfredo Sanchez H
-------------------
Hypertext Research Lab
Department of Computer Science
Texas A&M University

---

From: postarch (Postgres Mailing Archive)
Date: Tue, 04 Feb 92 19:38:57 PST

> * 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].

> Query sent to backend is "retrieve (foo.all) where locked "

Try:

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

> WARN:Feb  4 12:57:23:error : bogus integer

Try:

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

Jeff Meredith
[email-masked]