How to extract fields of anonymous row type in PostgreSQL?