| From: | Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> |
|---|---|
| To: | Josh Berkus <josh(at)agliodbs(dot)com> |
| Cc: | <pgsql-sql(at)postgresql(dot)org> |
| Subject: | Re: BOOLEAN question |
| Date: | 2002-10-29 03:53:52 |
| Message-ID: | 20021028194512.A87476-100000@megazone23.bigpanda.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Philip Van Hoof | 2002-10-29 18:23:41 | Creating Stored Procedures |
| Previous Message | Josh Berkus | 2002-10-29 01:29:35 | Re: BOOLEAN question |