Add \gdesc psql command.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 49ca462eb165dea297f1f110e8eac064308e9d51
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2017-09-05T22:17:47Z
Releases: 11.0
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

Files

PathChange+/−
doc/src/sgml/ref/psql-ref.sgml modified +19 −0
src/bin/psql/command.c modified +20 −0
src/bin/psql/common.c modified +128 −3
src/bin/psql/help.c modified +2 −1
src/bin/psql/settings.h modified +2 −1
src/bin/psql/tab-complete.c modified +1 −1
src/test/regress/expected/psql.out modified +85 −0
src/test/regress/sql/psql.sql modified +36 −0

Documentation touched

Discussion