pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: BOOLEAN question
Date: Mon, 28 Oct 2002 19:53:52 -0800 (PST)
Message-ID: <20021028194512.A87476-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <200210281729.35967.josh@agliodbs.com>

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)





view thread (10+ messages)  latest in thread

Message-ID: <20021028194512.A87476-100000@megazone23.bigpanda.com>
Permalink:  ../20021028194512.A87476-100000@megazone23.bigpanda.com/
Also on:    postgresql.org/message-id/20021028194512.A87476-100000@megazone23.bigpanda.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sszabo@megazone23.bigpanda.com, josh@agliodbs.com
  Subject: Re: BOOLEAN question
  In-Reply-To: <20021028194512.A87476-100000@megazone23.bigpanda.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox