Is there a way to know the names and types of columns a query returns? I'm not acquainted with using libpq at such a low level and I wonder if there is an API for it.