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 1pHwDn-0005cr-Ek for pgsql-general@arkaria.postgresql.org; Wed, 18 Jan 2023 00:22:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pHwDm-0006Mm-AA for pgsql-general@arkaria.postgresql.org; Wed, 18 Jan 2023 00:22:30 +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 1pHwDl-0006MP-Tr for pgsql-general@lists.postgresql.org; Wed, 18 Jan 2023 00:22:29 +0000 Received: from mail-qt1-x82a.google.com ([2607:f8b0:4864:20::82a]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pHwDf-0000ez-E8 for pgsql-general@lists.postgresql.org; Wed, 18 Jan 2023 00:22:28 +0000 Received: by mail-qt1-x82a.google.com with SMTP id r15so5496970qtx.6 for ; Tue, 17 Jan 2023 16:22:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=JIzzZw0/WkAQ2vGB2PZqAWz/jQg+H/3kMF8SijLQEp4=; b=n8rSWsW/+QQJ6+IDdOv8o5eI1vgopPEuylCDkjBIr6XeJdU2vT+Wx3edUnBLZ8bRkM HGAbzP2LuqDspNeFxPX+O/ZdXiPNk6xanmvjaDdXGiHjPCNtDmuOrIOb3qMwmWobwUvM Zr4sHqRe+VoWTRpoHw0vlAeJV9tGZVdYUeq3y+5psFSU1whBVLoEY3gVGIVQ0jrgqzpi UtXx3HXcC/nGMc63xn/Y0NDo/DaxJSIIDg5OojkBHAzuR3iESBukOuqyPGoHw2zGOoIh px7lTzh8CBkTa1i2+SsX5eeUnmQ1ZDLTsjs0zCWiEmZH9CnUX581JssEH3IA4jsnOR2S 4r/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=JIzzZw0/WkAQ2vGB2PZqAWz/jQg+H/3kMF8SijLQEp4=; b=HUT7GIiqsLNUKxfiKrb1L1CKKGeX42H/uYNPh2RUP9m96MboLs+OwmATR4yPfqClTF 2JfPQBpZAfbzy6rDw8xtigrW8i4mq/vv+80AUhYvki+KD2tkGYwt/6or/+HDL0oKYTkC tqLRtkPymC0VUne3ugZahk+rgEfu+b41o8TA+01FkretDs+lNBkCpk6V5Kh3S2XumwuO i0ILfAvm46JEVjWVWwql8TqYi4boZ8XC/FJZB+M+ueBU6sQVhfsQNGZfYFCCcF6c1/ES 47EHvSPTRT7ohG1ukbOsWPR7i6kNMkXwLchsfGtBlOT/aBO5uT9inYqfcq7KuT2DlacT pYXg== X-Gm-Message-State: AFqh2krujfj5HV5eFDdNne3ZKisulaGHw2wy+b1g2hhLYTYq9FrjYLFN 6wsk6ogMG39YiRuhHLLZTNwc5tdX5nU= X-Google-Smtp-Source: AMrXdXtyPIYo+wue41GzcviyBCfjlk6EnB4cG3EA2LiZBkTJWtXBDPznOPPk5Dw/plibcEzAPortdg== X-Received: by 2002:a05:622a:2519:b0:3b6:31e2:f53c with SMTP id cm25-20020a05622a251900b003b631e2f53cmr6765109qtb.3.1674001342312; Tue, 17 Jan 2023 16:22:22 -0800 (PST) Received: from [192.168.1.66] (108-250-206-84.lightspeed.nworla.sbcglobal.net. [108.250.206.84]) by smtp.googlemail.com with ESMTPSA id t13-20020ac8760d000000b003b63187dbe1sm3612651qtq.27.2023.01.17.16.22.21 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 Jan 2023 16:22:22 -0800 (PST) Content-Type: multipart/alternative; boundary="------------SCKxSnQRxZRFUOIkFPT40BYs" Message-ID: Date: Tue, 17 Jan 2023 18:22:21 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: Maintaining blank lines in psql output? Content-Language: en-US To: pgsql-general@lists.postgresql.org References: <04db9247-4452-e9bb-e64a-1545e04d37bc@gmail.com> From: Ron In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------SCKxSnQRxZRFUOIkFPT40BYs Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 1/17/23 15:22, David G. Johnston 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 \echo is exactly what I want, not only because of it's simplicity but since it doesn't generate numbers when \timing is enabled. (The primary use is for sql scripts generated by bash scripts and run from cron, where stdout and stderr are redirected to a log file.) -- Born in Arizona, moved to Babylonia. --------------SCKxSnQRxZRFUOIkFPT40BYs Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit On 1/17/23 15:22, David G. Johnston wrote:
On Tue, Jan 17, 2023 at 1:48 PM Ron <ronljohnsonjr@gmail.com> 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

\echo is exactly what I want, not only because of it's simplicity but since it doesn't generate numbers when \timing is enabled.

(The primary use is for sql scripts generated by bash scripts and run from cron, where stdout and stderr are redirected to a log file.)

--
Born in Arizona, moved to Babylonia.
--------------SCKxSnQRxZRFUOIkFPT40BYs--