[GENERAL] Any thoughts on making a psql meta-command "hide (or show alt text)if no results"? - Mailing list pgsql-general

From David G. Johnston
Subject [GENERAL] Any thoughts on making a psql meta-command "hide (or show alt text)if no results"?
Date
Msg-id CAKFQuwaZ+PncWtOZYZdMqPjWKc12qGNWPswwuw6TztR31Yh38A@mail.gmail.com
Whole thread Raw
Responses Re: [GENERAL] Any thoughts on making a psql meta-command "hide (orshow alt text) if no results"?  (Melvin Davidson <melvin6925@gmail.com>)
List pgsql-general
Hey all, looking for thoughts on a feature request:

I run quite a few queries, using psql, that are intended for exceptional situations.  When there are no results, which is expected, I still get the table header and basic frame showing up in the output.  The option I'd like is to be able to suppress the output of the empty table (and header if there is one) or possibly substitute the empty table with user-supplied text.

Thinking something that is used like \g

SELECT * FROM (VALUES (1)) vals (v) WHERE v = 0 \ghideifempty

[SQL] \galtifempty 'No values matching 0 in vals'

The names are descriptive, not suggestions...

David J.

pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [GENERAL] Compiling libpq only on Linux
Next
From: Melvin Davidson
Date:
Subject: Re: [GENERAL] Any thoughts on making a psql meta-command "hide (orshow alt text) if no results"?