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 /src/bin/psql/help.c | |
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 'src/bin/psql/help.c')
-rw-r--r-- | src/bin/psql/help.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c index 9d366180af5..4d1c0ec3c68 100644 --- a/src/bin/psql/help.c +++ b/src/bin/psql/help.c @@ -167,13 +167,14 @@ slashUsage(unsigned short int pager) * Use "psql --help=commands | wc" to count correctly. It's okay to count * the USE_READLINE line even in builds without that. */ - output = PageOutput(122, pager ? &(pset.popt.topt) : NULL); + output = PageOutput(125, pager ? &(pset.popt.topt) : NULL); fprintf(output, _("General\n")); fprintf(output, _(" \\copyright show PostgreSQL usage and distribution terms\n")); fprintf(output, _(" \\crosstabview [COLUMNS] execute query and display results in crosstab\n")); fprintf(output, _(" \\errverbose show most recent error message at maximum verbosity\n")); fprintf(output, _(" \\g [FILE] or ; execute query (and send results to file or |pipe)\n")); + fprintf(output, _(" \\gdesc describe result of query, without executing it\n")); fprintf(output, _(" \\gexec execute query, then execute each value in its result\n")); fprintf(output, _(" \\gset [PREFIX] execute query and store results in psql variables\n")); fprintf(output, _(" \\gx [FILE] as \\g, but forces expanded output mode\n")); |