aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/psql/command.c')
-rw-r--r--src/bin/psql/command.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 50dc43bf61a..3401b5183b0 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -822,6 +822,28 @@ exec_command(const char *cmd,
}
}
+ /* \errverbose -- display verbose message from last failed query */
+ else if (strcmp(cmd, "errverbose") == 0)
+ {
+ if (pset.last_error_result)
+ {
+ char *msg;
+
+ msg = PQresultVerboseErrorMessage(pset.last_error_result,
+ PQERRORS_VERBOSE,
+ PQSHOW_CONTEXT_ALWAYS);
+ if (msg)
+ {
+ psql_error("%s", msg);
+ PQfreemem(msg);
+ }
+ else
+ puts(_("out of memory"));
+ }
+ else
+ puts(_("There was no previous error."));
+ }
+
/* \f -- change field separator */
else if (strcmp(cmd, "f") == 0)
{