diff options
author | Tom Lane | 2017-09-05 22:17:47 +0000 |
---|---|---|
committer | Tom Lane | 2017-09-05 22:17:47 +0000 |
commit | 49ca462eb165dea297f1f110e8eac064308e9d51 (patch) | |
tree | 2e90d6bfe5b3be5d91b9fa8966dcbe274cb6f717 /doc/src | |
parent | 6e427aa4e5f3ad79a79b463c470daf93fa15767b (diff) |
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
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/ref/psql-ref.sgml | 19 |
1 files changed, 19 insertions, 0 deletions
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 @@ -1950,6 +1950,25 @@ Tue Oct 26 21:40:57 CEST 1999 <varlistentry> + <term><literal>\gdesc</literal></term> + + <listitem> + <para> + 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. + </para> + + <para> + If the current query buffer is empty, the most recently sent query + is described instead. + </para> + </listitem> + </varlistentry> + + + <varlistentry> <term><literal>\gexec</literal></term> <listitem> |