I'm looking for a way to get the return schema of a procedure in Postgresql. So for example, if the procedure returns a select from a table, it would be that particular result. So similar to the information schema to see the table columns, I need to see the columns returned in a procedure.
1 Answer
That information is in the proallargtypes and proargmodes columns of the pg_proc catalog table.
The output parameters (which are the result columns) will have an o or b in proargmodes.
If it is a function that is not declared with output parameters, then the result type is found in the prorettype column. If that is a composite type, its columns will be found in pg_attribute.