mirror of
https://github.com/postgres/postgres.git
synced 2025-12-21 05:21:08 +03:00
psql: Rename meta-command \close to \close_prepared
\close has been introduced in d55322b0da to be able to close a
prepared statement using the extended protocol in psql. Per discussion,
the name "close" is ambiguous. At the SQL level, CLOSE is used to close
a cursor. At protocol level, the close message can be used to either
close a statement or a portal.
This patch renames \close to \close_prepared to avoid any ambiguity and
make it clear that this is used to close a prepared statement. This new
name has been chosen based on the feedback from the author and the
reviewers.
Author: Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Reviewed-by: Jelte Fennema-Nio <postgres@jeltef.nl>
Discussion: https://postgr.es/m/3e694442-0df5-4f92-a08f-c5d4c4346b85@eisentraut.org
This commit is contained in:
@@ -67,8 +67,8 @@ static backslashResult exec_command_C(PsqlScanState scan_state, bool active_bran
|
||||
static backslashResult exec_command_connect(PsqlScanState scan_state, bool active_branch);
|
||||
static backslashResult exec_command_cd(PsqlScanState scan_state, bool active_branch,
|
||||
const char *cmd);
|
||||
static backslashResult exec_command_close(PsqlScanState scan_state, bool active_branch,
|
||||
const char *cmd);
|
||||
static backslashResult exec_command_close_prepared(PsqlScanState scan_state,
|
||||
bool active_branch, const char *cmd);
|
||||
static backslashResult exec_command_conninfo(PsqlScanState scan_state, bool active_branch);
|
||||
static backslashResult exec_command_copy(PsqlScanState scan_state, bool active_branch);
|
||||
static backslashResult exec_command_copyright(PsqlScanState scan_state, bool active_branch);
|
||||
@@ -330,8 +330,8 @@ exec_command(const char *cmd,
|
||||
status = exec_command_connect(scan_state, active_branch);
|
||||
else if (strcmp(cmd, "cd") == 0)
|
||||
status = exec_command_cd(scan_state, active_branch, cmd);
|
||||
else if (strcmp(cmd, "close") == 0)
|
||||
status = exec_command_close(scan_state, active_branch, cmd);
|
||||
else if (strcmp(cmd, "close_prepared") == 0)
|
||||
status = exec_command_close_prepared(scan_state, active_branch, cmd);
|
||||
else if (strcmp(cmd, "conninfo") == 0)
|
||||
status = exec_command_conninfo(scan_state, active_branch);
|
||||
else if (pg_strcasecmp(cmd, "copy") == 0)
|
||||
@@ -728,10 +728,10 @@ exec_command_cd(PsqlScanState scan_state, bool active_branch, const char *cmd)
|
||||
}
|
||||
|
||||
/*
|
||||
* \close -- close a previously prepared statement
|
||||
* \close_prepared -- close a previously prepared statement
|
||||
*/
|
||||
static backslashResult
|
||||
exec_command_close(PsqlScanState scan_state, bool active_branch, const char *cmd)
|
||||
exec_command_close_prepared(PsqlScanState scan_state, bool active_branch, const char *cmd)
|
||||
{
|
||||
backslashResult status = PSQL_CMD_SKIP_LINE;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user