Re: Boolean test - Mailing list pgsql-sql

From Christopher Kings-Lynne
Subject Re: Boolean test
Date
Msg-id GNELIHDDFBOCMGBFGEFOAEMFCBAA.chriskl@familyhealth.com.au
Whole thread Raw
In response to Boolean test  (Rudi Starcevic <rudi@oasis.net.au>)
List pgsql-sql
> I can't see why my sql here is throwing an error,
>     SELECT    *
>     FROM    plan_template
>     WHERE    public = true;
>
> The field public is 'boolean'

That should work perfectly...

> I've also tried :
>     WHERE    public = 'true';^^^ Won't work (I think)
>     WHERE    public = t;^^^ Won't work (I think)
>     WHERE    public = 't';^^^ Will work
>     WHERE    public = 'Yes';^^^ Won't work (I think)

However, the cleanest way to do it is like this:

SELECT *
FROM plan_template
WHERE public;

Since none of the above are working for you, I think there's something wrong
with your schema...

Chris




pgsql-sql by date:

Previous
From: Rudi Starcevic
Date:
Subject: Boolean test
Next
From: Peter Eisentraut
Date:
Subject: Re: Boolean test