Skip to content

Commit 78231ba

Browse files
committed
psql: Split extended query protocol meta-commands in --help=commands
Compared to v17 with only \bind able to do extended query protocol work, v18 has now a total of 11 meta-commands related to the extended query protocol. These were all listed under the "General" section of the --help=commands output and are specialized, bloating the output generated. All these meta-commands are moved into a new section called "Extended Query Protocol", listed at the end of --help=commands. This split has been suggested by Noah Misch. Discussion: https://postgr.es/m/20250415213450.1f.nmisch@google.com
1 parent 5743d12 commit 78231ba

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

src/bin/psql/help.c

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -161,29 +161,16 @@ slashUsage(unsigned short int pager)
161161
initPQExpBuffer(&buf);
162162

163163
HELP0("General\n");
164-
HELP0(" \\bind [PARAM]... set query parameters\n");
165-
HELP0(" \\bind_named STMT_NAME [PARAM]...\n"
166-
" set query parameters for an existing prepared statement\n");
167-
HELP0(" \\close STMT_NAME close an existing prepared statement\n");
168164
HELP0(" \\copyright show PostgreSQL usage and distribution terms\n");
169165
HELP0(" \\crosstabview [COLUMNS] execute query and display result in crosstab\n");
170-
HELP0(" \\endpipeline exit pipeline mode\n");
171166
HELP0(" \\errverbose show most recent error message at maximum verbosity\n");
172-
HELP0(" \\flush flush output data to the server\n");
173-
HELP0(" \\flushrequest send request to the server to flush its output buffer\n");
174167
HELP0(" \\g [(OPTIONS)] [FILE] execute query (and send result to file or |pipe);\n"
175168
" \\g with no arguments is equivalent to a semicolon\n");
176169
HELP0(" \\gdesc describe result of query, without executing it\n");
177-
HELP0(" \\getresults [NUM_RES] read NUM_RES pending results. All pending results are\n"
178-
" read if no argument is provided\n");
179170
HELP0(" \\gexec execute query, then execute each value in its result\n");
180171
HELP0(" \\gset [PREFIX] execute query and store result in psql variables\n");
181172
HELP0(" \\gx [(OPTIONS)] [FILE] as \\g, but forces expanded output mode\n");
182-
HELP0(" \\parse STMT_NAME create a prepared statement\n");
183173
HELP0(" \\q quit psql\n");
184-
HELP0(" \\sendpipeline send an extended query to an ongoing pipeline\n");
185-
HELP0(" \\startpipeline enter pipeline mode\n");
186-
HELP0(" \\syncpipeline add a synchronisation point to an ongoing pipeline\n");
187174
HELP0(" \\watch [[i=]SEC] [c=N] [m=MIN]\n"
188175
" execute query every SEC seconds, up to N times,\n"
189176
" stop if less than MIN rows are returned\n");
@@ -337,6 +324,22 @@ slashUsage(unsigned short int pager)
337324
HELP0(" \\prompt [TEXT] NAME prompt user to set internal variable\n");
338325
HELP0(" \\set [NAME [VALUE]] set internal variable, or list all if no parameters\n");
339326
HELP0(" \\unset NAME unset (delete) internal variable\n");
327+
HELP0("\n");
328+
329+
HELP0("Extended Query Protocol\n");
330+
HELP0(" \\bind [PARAM]... set query parameters\n");
331+
HELP0(" \\bind_named STMT_NAME [PARAM]...\n"
332+
" set query parameters for an existing prepared statement\n");
333+
HELP0(" \\close STMT_NAME close an existing prepared statement\n");
334+
HELP0(" \\endpipeline exit pipeline mode\n");
335+
HELP0(" \\flush flush output data to the server\n");
336+
HELP0(" \\flushrequest send request to the server to flush its output buffer\n");
337+
HELP0(" \\getresults [NUM_RES] read NUM_RES pending results. All pending results are\n"
338+
" read if no argument is provided\n");
339+
HELP0(" \\parse STMT_NAME create a prepared statement\n");
340+
HELP0(" \\sendpipeline send an extended query to an ongoing pipeline\n");
341+
HELP0(" \\startpipeline enter pipeline mode\n");
342+
HELP0(" \\syncpipeline add a synchronisation point to an ongoing pipeline\n");
340343

341344
/* Now we can count the lines. */
342345
nlcount = 0;

0 commit comments

Comments
 (0)