Load PostgreSQL logs into a PostgreSQL database. Functions can be invoked from within PostgreSQL to do this.
The Log parsing and loading functionsproject is a PostgreSQL Community project that is a part of the pgFoundry.
The pgFoundry page for the project is at http://pgfoundry.org/projects/loadlog, where you can find downloads, documentation, bug reports, mailing lists, and a whole lot more.