Re: proposal: psql PSQL_TABULAR_PAGER variable

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: psql PSQL_TABULAR_PAGER variable
Date: 2019-04-22 14:25:27
Message-ID: CAFj8pRA7ca8JEXYGc88sXG-rQUVcGdsHFZ_i1xm9VKtLfu-oOA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

po 22. 4. 2019 v 15:46 odesílatel Robert Haas <robertmhaas(at)gmail(dot)com>
napsal:

> On Thu, Apr 18, 2019 at 11:46 AM Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> wrote:
> > My idea is following - pseudocode
> >
> > if view is a table
> > {
> > if is_defined PSQL_TABULAR_PAGER
> > {
> > pager = PSQL_TABULAR_PAGER
> > }
> > else if is_defined PSQL_PAGER
> > {
> > pager = PSQL_PAGER
> > }
> > else
> > {
> > pager = PAGER
> > }
> > }
> > else /* for \h xxx */
> > {
> > if is_defined PSQL_PAGER
> > {
> > pager = PSQL_PAGER
> > }
> > else
> > {
> > pager = PAGER
> > }
> >
>
> Seems like pspg could just hand off to the regular pager if it
> discovers that the input is not in a format it finds suitable.
>

This is possible, and I wrote it. But it is "little bit" strange, start
another pager from a pager.

I think so task oriented pagers can enhance custom experience of TUI
applications - and there is a big space for enhancement.

Currently pspg have to reparse data and there are some heuristic to detect
format. Can be nice, if psql can send some additional info about the data.

Maybe psql can send raw data, and printing formatting can be on parser side.

Pavel

>
> --
> Robert Haas
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2019-04-22 14:47:20 Re: proposal: psql PSQL_TABULAR_PAGER variable
Previous Message Tom Lane 2019-04-22 14:21:39 Re: proposal: psql PSQL_TABULAR_PAGER variable