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.