Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qOW2h-0085GA-F2 for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Jul 2023 04:22:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qOW2f-002BcL-82 for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Jul 2023 04:22:29 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qOW2e-002BcC-Ut for pgsql-hackers@lists.postgresql.org; Wed, 26 Jul 2023 04:22:28 +0000 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qOW2c-001bym-35 for pgsql-hackers@lists.postgresql.org; Wed, 26 Jul 2023 04:22:27 +0000 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1b8ad9eede0so50088995ad.1 for ; Tue, 25 Jul 2023 21:22:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690345345; x=1690950145; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=7Th5ZF1RXdMrvI7UncvRu9J4dxxC6fNnLKe5143alpQ=; b=mPJCL10cIaBSBdtCaoUzj5LylYxxNAdhP0RVgxySEa8n/MG2bJGmf7YHI2Mo5gCY2P FaGakQn0iMscn0lbBNRFCCoxy9aEhzSV7iha4huXed4PJrWYp6FJTuUIxU5eVTdxREZ8 dn9cmgGevEiKYJGLIfiF6KRG6HqhrSax/ah3NAaah240hxifhurmGq6S7e012Nc28LF7 o99pea+fwBWEiA6+teAxz5OIGWxeXgP4xoTJNP7ONuUwkooiFSfmiRnr5ZGPsD0JFfeX UKbK0ccf4crwGxkE1B7UsEZ9Ef6TTqnCEA1oVYovJSUU5mV718iLzLB6IRTiAqXrmZ32 OCew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690345345; x=1690950145; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=7Th5ZF1RXdMrvI7UncvRu9J4dxxC6fNnLKe5143alpQ=; b=ayimMlphu9Sggg26Z1Tvod6rNLOxFcgctzYCrNQWhG1xKP+04E+RT3z1mwmyZyx5o/ 0MGSOfjOqYNSPgum+NFsEuyOiNbZKHR8wR02o0SCTWIg++kzdmWPvq5YNOFinsbxwlLh iNVsLEr5POeNt1E/UKtM7nwTgVf1noe2KgXzoE/1C3v19IVgszy4ZKG4+YerzxVuQstm HnhtAaGtzDgJI/5AqA65zD4ix8QUxGKEfSDCIMwLpB/S7FFFK6KfYUdIe0KkptacN1aX 7h+VzDJ8HfSYqrX0cP65L6mCR5/n8gfu+bnb0WzfIWOKoJYiF+WyV5YYW3aRUVXNnHq7 7ntg== X-Gm-Message-State: ABy/qLaxckKfj8a1gOouAprZyZ8r04MCQlbmaPADkEKcLE8upZXKArtb ZqPL9JL72g6xM5X5XtxIydU= X-Google-Smtp-Source: APBJJlFPWZXosFpThPxppaAIIY1mYX7uLSNOq3IZYvmsuP9k8YiAsX1qfcXbmiEbFbHUB/1GXAZHCA== X-Received: by 2002:a17:902:9a4a:b0:1bb:660:98d0 with SMTP id x10-20020a1709029a4a00b001bb066098d0mr1035956plv.59.1690345344912; Tue, 25 Jul 2023 21:22:24 -0700 (PDT) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id jb19-20020a170903259300b001b5247cac3dsm5573788plb.110.2023.07.25.21.22.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jul 2023 21:22:24 -0700 (PDT) Date: Tue, 25 Jul 2023 21:22:22 -0700 From: Nathan Bossart To: Alvaro Herrera Cc: "Andrey M. Borodin" , Kirk Wolak , Tom Lane , Laurenz Albe , Pavel Stehule , PostgreSQL Hackers Subject: Re: psql: Could we get "-- " prefixing on the **** QUERY **** outputs? (ECHO_HIDDEN) Message-ID: <20230726042222.GA3211130@nathanxps13> References: <20230519171616.snpyqyf7lxilteoa@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Qxx1br4bt0+wmkIi" Content-Disposition: inline In-Reply-To: <20230519171616.snpyqyf7lxilteoa@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Qxx1br4bt0+wmkIi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --Qxx1br4bt0+wmkIi Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v3-0001-Change-output-of-ECHO_HIDDEN-comments-to-be-SQL-c.patch" From 9346a1bbb2fc772527e4b1df82cfdc2dfbc5afb0 Mon Sep 17 00:00:00 2001 From: Kirk Wolak 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 Reviewed By: Pavel Stehule Reviewed By: Laurenz Albe 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 --Qxx1br4bt0+wmkIi--