From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jan Dittmer <jdi@l4x.org>
Cc: jim@contactbda.com
Cc: pgsql-performance@postgresql.org
Subject: Re: Better way to write aggregates?
Date: Fri, 21 Apr 2006 10:26:16 -0400
Message-ID: <9496.1145629576@sss.pgh.pa.us> (raw)
In-Reply-To: <4448D195.4020801@l4x.org>
References: <444899B6.6090001@l4x.org>
<20060421122617.M81850@contactbda.com>
<4448D195.4020801@l4x.org>
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
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-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, jdi@l4x.org, jim@contactbda.com
Subject: Re: Better way to write aggregates?
In-Reply-To: <9496.1145629576@sss.pgh.pa.us>
* 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