Forum OpenACS Development: Re: Crossing table rows to rows and columns
I recommend installing tablefunc. It's available as a PostgreSQL contrib module. OpenACS doesn't have any specific requirements for it, but there's a lot of create stuff in there, if you are still using PostgreSQL 9.
Look into how your OS installed the PostgreSQL contrib packages. Then you can just create a SQL upgrade script to install it into your database.
I've used tablefunc with OpenACS projects since PostgreSQL 9 was new.
CREATE EXTENSION IF NOT EXISTS tablefunc;
If this works, your are done, you can use the crosstab family
oacs-5-10=# \df crosstab
crosstab crosstab2 crosstab3 crosstab4
otherwise progress as Dave suggested