Describe the result in PostgreSQL?

Microsoft Sql Server has a proc sys.sp_describe_first_result_setthat takes an arbitrary sql query string and returns data describing the types that will be in the result set, whether they should be executed. Please note that this is a description of the results of a complex query, not a table. MSDN Link

Is there something similar for Postgres?

+4
source share
2 answers

at the protocol level , in the Describe form in the extended request protocol .

SQL- SQL. ; pgsql-general. , .

, exec_describe_statement_message src/backend/tcop/postgres.c , SendRowDescriptionMessage src/backend/access/common/printtup.c. C . , , ; :

  • SQL //,
  • node, . RETURNING node DML Query tlist SELECT.
  • tlist ExecTypeFromTL
  • tupledesc, resjunk, tlist .
0

, temperory view, _., .

0

All Articles