Re: BOOLEAN question - Mailing list pgsql-sql

From Stephan Szabo
Subject Re: BOOLEAN question
Date
Msg-id 20021028194512.A87476-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Re: BOOLEAN question  (Josh Berkus <josh@agliodbs.com>)
List pgsql-sql
On Mon, 28 Oct 2002, Josh Berkus wrote:

> Stephan,
>
> > Well, you might be better off making a max(bool), but a not
> > super-efficient version might be:
> >  max(case when col then 1 else 0 end)=1
>
> Good, I'm not just brain-dead.   I did figure out another way to do it, but if
> I wrote a MAX(bool), what are the chances it would get added to the core?   I
> don't see any good reason not to have one.

Don't know really.  I guess if we're saying that true>false it might
make sense, although the notion of max(bool) seems odd to me, especially
since it only easily handles an ANY case.

Speaking of which, a more expensive but possibly nicer looking way would
be something like
true=ANY(select col from <whatever>)

(which of course also generalizes into =ALL fairly easily)




pgsql-sql by date:

Previous
From: Josh Berkus
Date:
Subject: Re: BOOLEAN question
Next
From: "John Ragan"
Date:
Subject: Re: CoreReader