Re: Better way to write aggregates?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jan Dittmer <jdi(at)l4x(dot)org>
Cc: jim(at)contactbda(dot)com, pgsql-performance(at)postgresql(dot)org
Subject: Re: Better way to write aggregates?
Date: 2006-04-21 14:26:16
Message-ID: 9496.1145629576@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Jan Dittmer <jdi(at)l4x(dot)org> writes:
> It would help if booleans could be casted to integer 1/0 :-)

As of 8.1 there is such a cast in the system:

regression=# select 't'::bool::int;
int4
------
1
(1 row)

In earlier releases you can make your own.

As for the original question, though: have you looked at the crosstab
functions in contrib/tablefunc?

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Alex Hayward 2006-04-21 15:24:42 Re: Hardware: HP StorageWorks MSA 1500
Previous Message Dave Dutcher 2006-04-21 13:54:16 Re: Little use of CPU ( < 5%)