From: raf <raf@raf.org>
To: pgsql-general@lists.postgresql.org
Subject: Re: Maintaining blank lines in psql output?
Date: Wed, 18 Jan 2023 10:21:26 +1100
Message-ID: <Y8ctdjpr/2UtrwEF@raf.org> (raw)
In-Reply-To: <CAKFQuwYHQH8uXFWFXaiCtmuYPpXkvqgO_k4ZbrPwO4YpH-8=wg@mail.gmail.com>
References: <04db9247-4452-e9bb-e64a-1545e04d37bc@gmail.com>
<CAKFQuwaMLnyBzoOv0oKXpcyUhS+hk29ZVj2LAS665QRG5t06Kw@mail.gmail.com>
<Y8cqC1HyhglNAmdL@raf.org>
<CAKFQuwYHQH8uXFWFXaiCtmuYPpXkvqgO_k4ZbrPwO4YpH-8=wg@mail.gmail.com>
On Tue, Jan 17, 2023 at 04:10:50PM -0700, "David G. Johnston" <david.g.johnston@gmail.com> wrote:
> On Tue, Jan 17, 2023 at 4:07 PM raf <raf@raf.org> 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 <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
> > >
> > > 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
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: raf@raf.org
Subject: Re: Maintaining blank lines in psql output?
In-Reply-To: <Y8ctdjpr/2UtrwEF@raf.org>
References: <04db9247-4452-e9bb-e64a-1545e04d37bc@gmail.com> <CAKFQuwaMLnyBzoOv0oKXpcyUhS+hk29ZVj2LAS665QRG5t06Kw@mail.gmail.com> <Y8cqC1HyhglNAmdL@raf.org> <CAKFQuwYHQH8uXFWFXaiCtmuYPpXkvqgO_k4ZbrPwO4YpH-8=wg@mail.gmail.com> <Y8ctdjpr/2UtrwEF@raf.org>
* 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