Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 378C6476701 for ; Mon, 28 Oct 2002 22:54:06 -0500 (EST) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id BDAA3475FB7 for ; Mon, 28 Oct 2002 22:54:05 -0500 (EST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 07521D60C; Mon, 28 Oct 2002 19:53:52 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id C48C15C04; Mon, 28 Oct 2002 19:53:52 -0800 (PST) Date: Mon, 28 Oct 2002 19:53:52 -0800 (PST) From: Stephan Szabo To: Josh Berkus Cc: Subject: Re: BOOLEAN question In-Reply-To: <200210281729.35967.josh@agliodbs.com> Message-ID: <20021028194512.A87476-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/387 X-Sequence-Number: 10104 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 ) (which of course also generalizes into =ALL fairly easily)