Re: Re: [COMMITTERS] pgsql: psql: show proper row count in \x mode for zero-column output

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>, Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [COMMITTERS] pgsql: psql: show proper row count in \x mode for zero-column output
Date: 2015-06-26 22:38:39
Message-ID: 558DD46F.5020801@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On 6/25/15 9:42 AM, Peter Eisentraut wrote:
> On 3/24/15 9:04 PM, Bruce Momjian wrote:
>> psql: show proper row count in \x mode for zero-column output
>>
>> Also, fix pager enable selection for such cases, and other cleanups for
>> zero-column output.
>>
>> Report by Thom Brown
>>
>> Branch
>> ------
>> master
>>
>> Details
>> -------
>> http://git.postgresql.org/pg/commitdiff/376a0c4547fe98c45476647596ce9c9b394f8415
>
> This change added an extra blank line to the output of a zero-row result.
>
> Compare:
>
> [9.4]
> $ psql -X -d postgres -c 'select * from pg_class where false' -x
> (No rows)
> $
>
> [9.5]
> $ psql -X -d postgres -c 'select * from pg_class where false' -x
> (0 rows)
>
> $
>
>
> Was that intentional?

That's consistent with what > 0 rows does, so it seems the correct thing
to do. Going from "(No rows)" to "(0 rows)" is going to break things
anyway, so I don't see a backwards compatibility issue here.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Data in Trouble? Get it in Treble! http://BlueTreble.com

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Simon Riggs 2015-06-26 23:48:53 pgsql: Avoid hot standby cancels from VAC FREEZE
Previous Message Alvaro Herrera 2015-06-26 21:25:28 pgsql: Fix DDL command collection for TRANSFORM

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2015-06-26 22:39:19 Re: 9.5 release notes
Previous Message Jim Nasby 2015-06-26 22:35:10 Re: UPSERT on partition