Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kkqai-0000Zz-RI for pgsql-general@arkaria.postgresql.org; Thu, 03 Dec 2020 15:32:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kkqah-0004J6-Oz for pgsql-general@arkaria.postgresql.org; Thu, 03 Dec 2020 15:32:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kkqah-0004Iz-HC for pgsql-general@lists.postgresql.org; Thu, 03 Dec 2020 15:32:19 +0000 Received: from mail.verite.pro ([185.16.44.216]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kkqaf-0005ha-49 for pgsql-general@postgresql.org; Thu, 03 Dec 2020 15:32:18 +0000 Received: from sd-76392.dedibox.fr (195-154-133-58.rev.poneytelecom.eu [195.154.133.58]) by mail.verite.pro (Postfix) with ESMTP id 05BD08C012A; Thu, 3 Dec 2020 16:22:13 +0100 (CET) Received: by sd-76392.dedibox.fr (Postfix, from userid 1000) id 2D8542240203; Thu, 3 Dec 2020 16:32:14 +0100 (CET) Content-Type: text/plain; charset="iso-8859-15" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: "Daniel Verite" Subject: Re: psql > split > queries & output To: wim.bertels@ucll.be Cc: "pgsql-general" In-Reply-To: <57e6b560f3517ef2da72b4604faabd9af36d3e9c.camel@ucll.be> Date: Thu, 03 Dec 2020 16:32:11 +0100 Message-Id: <8e16d6cc-3fbb-4789-ac54-b6e92e9d64dd@manitou-mail.org> X-Mailer: Manitou v1.7.3 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Wim Bertels wrote: > but interactively this doesn't seem to work Interactively something like this might do the job: $ PSQL_HISTORY=3D/tmp/queries.txt psql -L /tmp/logfile.txt After running some queries, and a clean exit from psql: $ cat /tmp/queries.txt select 1; select 2; $ cat /tmp/logfile.txt=20 ********* QUERY ********** select 1; ************************** ?column?=20 ---------- 1 (1 row) ********* QUERY ********** select 2; ************************** ?column?=20 ---------- 2 (1 row) Best regards, --=20 Daniel V=E9rit=E9 PostgreSQL-powered mailer: https://www.manitou-mail.org Twitter: @DanielVerite