Add \gdesc psql command.
Tom Lane <tgl@sss.pgh.pa.us>
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
| Path | Change | +/− |
|---|---|---|
| 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
- proposal psql \gdesc 31 messages · 2017-04-28 → 2017-09-06