http://www.postgresql.org/docs/techdocs.17

returning multiple rows from a function in postgresql