Re: [patch] Proposal for \crosstabview in psql - Mailing list pgsql-hackers

From Daniel Verite
Subject Re: [patch] Proposal for \crosstabview in psql
Date
Msg-id 0c33d4ad-f268-4617-8ab5-2ea4896b37c0@mm
Whole thread Raw
In response to Re: [patch] Proposal for \crosstabview in psql  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Responses Re: [patch] Proposal for \crosstabview in psql
List pgsql-hackers
    Dean Rasheed wrote:

> I don't think we should allow sorting colV values client-side,
> overriding a server-side ORDER BY clause in the query.

I shared that opinion until (IIRC) the v8 or v9 of the patch.
Most of the evolution of this patch has been to go
from no client-side sorting option at all, to the full range
of possibilities, ascending or descending, and in both
vertical and horizontal directions.

I agree that colV sorting can be achieved through the
query's ORDER BY, which additionally is more efficient
so it should be the primary choice.

The reason to allow [+/-]colV in \crosstabview is because
I think the average user will expect it, by symmetry with colH.
As the display is reorganized to be like a "grid" instead of a "list
with several columns", we shift the focus to the symmetry
between horizontal and vertical headers, rather than on
the pre-crosstab form of the resultset, even if it's the
same data.
It's easier for the user to just stick a + in front of a column
reference than to figure out that the same result could
be achieved by editing the query and changing/adding
an ORDER BY.

Or said otherwise, having the [+/-] colV sorting is a way to
avoid the question:
"we can sort the horizontal header, so why can't we sort the
vertical header just the same?"


Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: ALTER EXTENSION DROP FUNCTION not working ?
Next
From: Andrew Dunstan
Date:
Subject: Re: Tracing down buildfarm "postmaster does not shut down" failures