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 1pHvGu-0007aP-PK for pgsql-general@arkaria.postgresql.org; Tue, 17 Jan 2023 23:21:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pHvGt-0001Ib-Nq for pgsql-general@arkaria.postgresql.org; Tue, 17 Jan 2023 23:21:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pHvGt-0001Ge-DI for pgsql-general@lists.postgresql.org; Tue, 17 Jan 2023 23:21:39 +0000 Received: from ook.raf.org ([139.99.156.21]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pHvGr-0002v8-77 for pgsql-general@lists.postgresql.org; Tue, 17 Jan 2023 23:21:39 +0000 Received: from localhost (localhost [127.0.0.1]) by ook.raf.org (Postfix) with ESMTP id 4E68E5DFA1 for ; Wed, 18 Jan 2023 10:21:28 +1100 (AEDT) X-Virus-Scanned: Debian amavisd-new at ook.raf.org Received: from ook.raf.org ([127.0.0.1]) by localhost (ook.raf.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id N7zxtr4X4cm8 for ; Wed, 18 Jan 2023 10:21:26 +1100 (AEDT) Received: by ook.raf.org (Postfix, from userid 1001) id E60C161DD7; Wed, 18 Jan 2023 10:21:26 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raf.org; s=001; t=1673997686; bh=V9CM2Z+fsCDYONWQ9QczHA8yrVOvQduSELMTZ3kVgPA=; h=Date:From:To:Subject:References:In-Reply-To:From; b=gHAiPtgTS/xfLw3tvntTbPxp36tI0eWEN+SCW+Gp2qeSCGC/KJTdFp22TZTCTYB9q VxEq2Y1vKTlbxk3YhynXEaPxruz+a8IUZKsFI6v/RqxtVTXE0vyYKwitEMP0BILSj1 5Z8HijyDRHT+EfzE5ZsoCAiO2MKWYSL9woF16Zne9VFMJzuia2mw+AJUMfgFSX0sHN FfflUQN40jQxlhzllW8N8o3czcxwmgF0ZaSURMOLTf8/ByTbf55YWhx0cxpAEf+7Tm CUYEABamfLShgKbjyanzPGp5y1D2xdhRjH90r8vRMshjQVfsQAsWIF7YPxPYWTxivG 3Ud/xj1vHrd7g== Date: Wed, 18 Jan 2023 10:21:26 +1100 From: raf To: pgsql-general@lists.postgresql.org Subject: Re: Maintaining blank lines in psql output? Message-ID: References: <04db9247-4452-e9bb-e64a-1545e04d37bc@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Jan 17, 2023 at 04:10:50PM -0700, "David G. Johnston" wrote: > On Tue, Jan 17, 2023 at 4:07 PM raf wrote: > > > On Tue, Jan 17, 2023 at 02:22:22PM -0700, "David G. Johnston" < > > david.g.johnston@gmail.com> wrote: > > > > > On Tue, Jan 17, 2023 at 1:48 PM Ron wrote: > > > > > > > > > > > White space can of course make things easy to read, but psql seems to > > > > ignore > > > > those blank lines. Is there any way to retain them in psql output? > > > > > > > > > > > Nope, there is no setting for psql to print all blank lines it encounters > > > to stdout. If you want to format your output with stuff other than query > > > results it provides \echo > > > > > > David J. > > > > Perhaps the best you can do is something like adding: > > > > select ''; > > > > or > > > > raise notice ''; > > > > It won't result in just a blank line, but it will separate things. > > > > > Those both seem much more complicated than \echo for the same (or worse) > effect. You'd have to wrap the raise notice inside a do block which itself > would then be executed by the server... > > David J. Good point. I didn't read it right. select/raise make more sense out of the context of psql (i.e. in sql/plpgsql). \echo makes more sense in psql. cheers, raf