Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Describe result set in PostgreSQL?

In Microsoft Sql Server, there is a proc sys.sp_describe_first_result_set which takes an arbitrary sql query string and returns data describing the types that would be in the result set, were it to be executed. Note, this is describing the results of a complex query, not a table. MSDN reference

Is there anything similar for Postgres?

like image 337
Robert Jeppesen Avatar asked Nov 01 '22 17:11

Robert Jeppesen


1 Answers

I tried to do this by creating a stored procedure to create temperory view then check information_schema.columns before droping the view.

like image 177
Ben Avatar answered Dec 03 '22 01:12

Ben