Re: Better way to write aggregates? - Mailing list pgsql-performance

From Tom Lane
Subject Re: Better way to write aggregates?
Date
Msg-id 9496.1145629576@sss.pgh.pa.us
Whole thread Raw
In response to Re: Better way to write aggregates?  (Jan Dittmer <jdi@l4x.org>)
List pgsql-performance
Jan Dittmer <jdi@l4x.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

pgsql-performance by date:

Previous
From: "Dave Dutcher"
Date:
Subject: Re: Little use of CPU ( < 5%)
Next
From: Alex Hayward
Date:
Subject: Re: Hardware: HP StorageWorks MSA 1500