From 49ca462eb165dea297f1f110e8eac064308e9d51 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 5 Sep 2017 18:17:47 -0400 Subject: Add \gdesc psql command. This command acts somewhat like \g, but instead of executing the query buffer, it merely prints a description of the columns that the query result would have. (Of course, this still requires parsing the query; if parse analysis fails, you get an error anyway.) We accomplish this using an unnamed prepared statement, which should be invisible to psql users. Pavel Stehule, reviewed by Fabien Coelho Discussion: https://postgr.es/m/CAFj8pRBhYVvO34FU=EKb=nAF5t3b++krKt1FneCmR0kuF5m-QA@mail.gmail.com --- doc/src/sgml/ref/psql-ref.sgml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index fd2ca15d0aa..5bdbc1e9cf2 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -1949,6 +1949,25 @@ Tue Oct 26 21:40:57 CEST 1999 + + \gdesc + + + + Shows the description (that is, the column names and data types) + of the result of the current query buffer. The query is not + actually executed; however, if it contains some type of syntax + error, that error will be reported in the normal way. + + + + If the current query buffer is empty, the most recently sent query + is described instead. + + + + + \gexec -- cgit v1.2.3