pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Andrey M. Borodin <x4mmm@yandex-team.ru>
Cc: Kirk Wolak <wolakk@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: psql: Could we get "-- " prefixing on the **** QUERY **** outputs? (ECHO_HIDDEN)
Date: Tue, 25 Jul 2023 21:22:22 -0700
Message-ID: <20230726042222.GA3211130@nathanxps13> (raw)
In-Reply-To: <20230519171616.snpyqyf7lxilteoa@alvherre.pgsql>
References: <ECCAF44F-7A15-4D65-851D-7FB5963A0B90@yandex-team.ru>
	<20230519171616.snpyqyf7lxilteoa@alvherre.pgsql>

I took a look at this patch and changed a couple things:

 * I made a similar adjustment to a few lines that seem to have been
   missed.
 * I removed a couple of asterisks from the adjusted lines in order to
   maintain the existing line lengths.

Barring additional feedback, I think this is ready for commit.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com

Attachments:

v3-0001-Change-output-of-ECHO_HIDDEN-comments-to-be-SQL-c.patch (text/x-diff, 3.1K) download From 9346a1bbb2fc772527e4b1df82cfdc2dfbc5afb0 Mon Sep 17 00:00:00 2001 From: Kirk Wolak <wolakk@gmail.com> Date: Wed, 17 May 2023 16:59:02 -0400 Subject: [PATCH v3 1/1] 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. Author: Kirk Wolak <wolakk@gmail.com> Reviewed By: Pavel Stehule <pavel.stehule@gmail.com> Reviewed By: Laurenz Albe <laurenz.albe@cybertec.at> Thread: https://postgr.es/m/CACLU5mTFJRJYtbvmZ26txGgmXWQo0hkGhH2o3hEquUPmSbGtBw@mail.gmail.com --- src/bin/psql/command.c | 8 ++++---- src/bin/psql/common.c | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c index 6733f008fd..1300869d79 100644 --- a/src/bin/psql/command.c +++ b/src/bin/psql/command.c @@ -5395,16 +5395,16 @@ echo_hidden_command(const char *query) { if (pset.echo_hidden != PSQL_ECHO_HIDDEN_OFF) { - printf(_("********* QUERY **********\n" + printf(_("/******** QUERY *********/\n" "%s\n" - "**************************\n\n"), query); + "/************************/\n\n"), query); fflush(stdout); if (pset.logfile) { fprintf(pset.logfile, - _("********* QUERY **********\n" + _("/******** QUERY *********/\n" "%s\n" - "**************************\n\n"), query); + "/************************/\n\n"), query); fflush(pset.logfile); } diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c index 5973df2e39..10ad1f2538 100644 --- a/src/bin/psql/common.c +++ b/src/bin/psql/common.c @@ -589,16 +589,16 @@ PSQLexec(const char *query) if (pset.echo_hidden != PSQL_ECHO_HIDDEN_OFF) { - printf(_("********* QUERY **********\n" + printf(_("/******** QUERY *********/\n" "%s\n" - "**************************\n\n"), query); + "/************************/\n\n"), query); fflush(stdout); if (pset.logfile) { fprintf(pset.logfile, - _("********* QUERY **********\n" + _("/******** QUERY *********/\n" "%s\n" - "**************************\n\n"), query); + "/************************/\n\n"), query); fflush(pset.logfile); } @@ -1060,9 +1060,9 @@ SendQuery(const char *query) char buf[3]; fflush(stderr); - printf(_("***(Single step mode: verify command)*******************************************\n" + printf(_("/**(Single step mode: verify command)******************************************/\n" "%s\n" - "***(press return to proceed or enter x and return to cancel)********************\n"), + "/**(press return to proceed or enter x and return to cancel)*******************/\n"), query); fflush(stdout); if (fgets(buf, sizeof(buf), stdin) != NULL) @@ -1080,9 +1080,9 @@ SendQuery(const char *query) if (pset.logfile) { fprintf(pset.logfile, - _("********* QUERY **********\n" + _("/******** QUERY *********/\n" "%s\n" - "**************************\n\n"), query); + "/************************/\n\n"), query); fflush(pset.logfile); } -- 2.25.1

view thread (20+ messages)  latest in thread

Message-ID: <20230726042222.GA3211130@nathanxps13>
Permalink:  ../20230726042222.GA3211130@nathanxps13/
Also on:    postgresql.org/message-id/20230726042222.GA3211130@nathanxps13

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: nathandbossart@gmail.com, alvherre@alvh.no-ip.org, x4mmm@yandex-team.ru, wolakk@gmail.com, tgl@sss.pgh.pa.us, laurenz.albe@cybertec.at, pavel.stehule@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: psql: Could we get "-- " prefixing on the **** QUERY **** outputs? (ECHO_HIDDEN)
  In-Reply-To: <20230726042222.GA3211130@nathanxps13>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox