From 31d85797a45e86660266e693d6c23c30b34935cc Mon Sep 17 00:00:00 2001 From: Kirk Wolak Date: Wed, 17 May 2023 13:15:57 -0400 Subject: [PATCH] Change output of ECHO_HIDDEN comments to be SQL comments Simply Add the "/" Required before/after the ********* QUERY ********** (SHOW_HIDDEN on) so that they are comments and are ignored if you copy and paste a series of them. Also removed the trailing row of asterisks. When you have more than one query they are just noise. The query ends with an extra \n for spacing. Author: Kirk Wolak Reviewed-By: "okbob@github.com" Thread: https://postgr.es/m/CACLU5mSYSC-7waxNE0bsrph7QW9Bq9Dw5M26swmQ6x6iSd1tdQ@mail.gmail.com --- src/bin/psql/command.c | 10 ++++------ src/bin/psql/common.c | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c index 607a57715a..c26b807590 100644 --- a/src/bin/psql/command.c +++ b/src/bin/psql/command.c @@ -5388,16 +5388,14 @@ echo_hidden_command(const char *query) { if (pset.echo_hidden != PSQL_ECHO_HIDDEN_OFF) { - printf(_("********* QUERY **********\n" - "%s\n" - "**************************\n\n"), query); + printf(_("/********* QUERY **********/\n" + "%s\n\n"), query); fflush(stdout); if (pset.logfile) { fprintf(pset.logfile, - _("********* QUERY **********\n" - "%s\n" - "**************************\n\n"), query); + _("/********* QUERY **********/\n" + "%s\n\n"), query); fflush(pset.logfile); } diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c index c0e6e8e6ed..39155ca0d8 100644 --- a/src/bin/psql/common.c +++ b/src/bin/psql/common.c @@ -589,16 +589,14 @@ PSQLexec(const char *query) if (pset.echo_hidden != PSQL_ECHO_HIDDEN_OFF) { - printf(_("********* QUERY **********\n" - "%s\n" - "**************************\n\n"), query); + printf(_("/********* QUERY **********/\n" + "%s\n\n"), query); fflush(stdout); if (pset.logfile) { fprintf(pset.logfile, - _("********* QUERY **********\n" - "%s\n" - "**************************\n\n"), query); + _("/********* QUERY **********/\n" + "%s\n\n"), query); fflush(pset.logfile); } -- 2.34.1