Re: [patch] Proposal for \crosstabview in psql
От
Daniel Verite
Тема
Re: [patch] Proposal for \crosstabview in psql
Дата
Msg-id
b00796a3-c2d2-4a24-bf13-b4a678048f49@mm
Ответ на
Re: [patch] Proposal for \crosstabview in psql (Robert Haas)
Список
Дерево обсуждения
[patch] Proposal for \rotate in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \rotate in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \rotate in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \rotate in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \rotate in psql David Fetter <david@fetter.org>
Re: [patch] Proposal for \rotate in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \rotate in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \rotate in psql Greg Stark <stark@mit.edu>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \rotate in psql "David G. Johnston" <david.g.johnston@gmail.com>
Re: [patch] Proposal for \rotate in psql Robert Haas <robertmhaas@gmail.com>
Re: [patch] Proposal for \rotate in psql "David G. Johnston" <david.g.johnston@gmail.com>
Re: [patch] Proposal for \rotate in psql Robert Haas <robertmhaas@gmail.com>
Re: [patch] Proposal for \rotate in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \rotate in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \rotate in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \rotate in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \rotate in psql Joe Conway <mail@joeconway.com>
Re: [patch] Proposal for \rotate in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \rotate in psql David Fetter <david@fetter.org>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \rotate in psql Craig Ringer <craig@2ndquadrant.com>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \rotate in psql Joe Conway <mail@joeconway.com>
Re: [patch] Proposal for \rotate in psql Alvaro Herrera <alvherre@2ndquadrant.com>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \rotate in psql Joe Conway <mail@joeconway.com>
Re: [patch] Proposal for \rotate in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \rotate in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \rotate in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \rotate in psql Michael Paquier <michael.paquier@gmail.com>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \crosstabview in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \crosstabview in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \crosstabview in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \crosstabview in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \crosstabview in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \crosstabview in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \crosstabview in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \crosstabview in psql Teodor Sigaev <teodor@sigaev.ru>
Re: [patch] Proposal for \crosstabview in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \crosstabview in psql Alvaro Herrera <alvherre@2ndquadrant.com>
Re: [patch] Proposal for \crosstabview in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \crosstabview in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \crosstabview in psql Alvaro Herrera <alvherre@2ndquadrant.com>
Re: [patch] Proposal for \crosstabview in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \crosstabview in psql Jim Nasby <Jim.Nasby@BlueTreble.com>
Re: [patch] Proposal for \crosstabview in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \crosstabview in psql Dean Rasheed <dean.a.rasheed@gmail.com>
Re: [patch] Proposal for \crosstabview in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \crosstabview in psql Tom Lane <tgl@sss.pgh.pa.us>
Re: [patch] Proposal for \crosstabview in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \crosstabview in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \crosstabview in psql Andres Freund <andres@anarazel.de>
Re: [patch] Proposal for \crosstabview in psql Dean Rasheed <dean.a.rasheed@gmail.com>
Re: [patch] Proposal for \crosstabview in psql Jim Nasby <Jim.Nasby@BlueTreble.com>
Re: [patch] Proposal for \crosstabview in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \crosstabview in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \crosstabview in psql Dean Rasheed <dean.a.rasheed@gmail.com>
Re: [patch] Proposal for \crosstabview in psql Jim Nasby <Jim.Nasby@BlueTreble.com>
Re: [patch] Proposal for \crosstabview in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \crosstabview in psql Dean Rasheed <dean.a.rasheed@gmail.com>
Re: [patch] Proposal for \crosstabview in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \crosstabview in psql Robert Haas <robertmhaas@gmail.com>
Re: [patch] Proposal for \crosstabview in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \crosstabview in psql Robert Haas <robertmhaas@gmail.com>
Re: [patch] Proposal for \crosstabview in psql Robert Haas <robertmhaas@gmail.com>
Re: [patch] Proposal for \crosstabview in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \crosstabview in psql Alvaro Herrera <alvherre@2ndquadrant.com>
Re: [patch] Proposal for \crosstabview in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \crosstabview in psql Alvaro Herrera <alvherre@2ndquadrant.com>
Re: [patch] Proposal for \crosstabview in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \crosstabview in psql Alvaro Herrera <alvherre@2ndquadrant.com>
Re: [patch] Proposal for \crosstabview in psql Alvaro Herrera <alvherre@2ndquadrant.com>
Re: [patch] Proposal for \crosstabview in psql Alvaro Herrera <alvherre@2ndquadrant.com>
Re: [patch] Proposal for \crosstabview in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \crosstabview in psql Alvaro Herrera <alvherre@2ndquadrant.com>
[patch] \crosstabview documentation Christoph Berg <myon@debian.org>
Re: [patch] \crosstabview documentation Christoph Berg <myon@debian.org>
Re: [patch] \crosstabview documentation Tom Lane <tgl@sss.pgh.pa.us>
Re: [patch] \crosstabview documentation Christoph Berg <myon@debian.org>
Re: [patch] \crosstabview documentation Tom Lane <tgl@sss.pgh.pa.us>
Re: [patch] \crosstabview documentation "David G. Johnston" <david.g.johnston@gmail.com>
Re: [patch] \crosstabview documentation Alvaro Herrera <alvherre@2ndquadrant.com>
Re: [patch] \crosstabview documentation "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \crosstabview in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \crosstabview in psql Robert Haas <robertmhaas@gmail.com>
Re: [patch] Proposal for \crosstabview in psql Alvaro Herrera <alvherre@2ndquadrant.com>
Re: [patch] Proposal for \crosstabview in psql "David G. Johnston" <david.g.johnston@gmail.com>
Re: [patch] Proposal for \crosstabview in psql Alvaro Herrera <alvherre@2ndquadrant.com>
Re: [patch] Proposal for \crosstabview in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \crosstabview in psql Robert Haas <robertmhaas@gmail.com>
Re: [patch] Proposal for \crosstabview in psql Alvaro Herrera <alvherre@2ndquadrant.com>
Re: [patch] Proposal for \crosstabview in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \crosstabview in psql Jim Nasby <Jim.Nasby@BlueTreble.com>
Re: [patch] Proposal for \crosstabview in psql Alvaro Herrera <alvherre@2ndquadrant.com>
Re: [patch] Proposal for \crosstabview in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \crosstabview in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \crosstabview in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \crosstabview in psql Dean Rasheed <dean.a.rasheed@gmail.com>
Re: [patch] Proposal for \crosstabview in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \crosstabview in psql Peter Eisentraut <peter_e@gmx.net>
Re: [patch] Proposal for \crosstabview in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \crosstabview in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \crosstabview in psql Dean Rasheed <dean.a.rasheed@gmail.com>
Re: [patch] Proposal for \crosstabview in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \crosstabview in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \rotate in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \rotate in psql Marcin Mańk <marcin@maniek.info>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [patch] Proposal for \rotate in psql Robert Haas <robertmhaas@gmail.com>
Re: [patch] Proposal for \rotate in psql Pavel Stehule <pavel.stehule@gmail.com>
Robert Haas wrote:
> But worse than either of those things, there is no real
> agreement on what the overall design of this feature
> should be.
The part in the design that raised concerns upthread is
essentially how headers sorting is exposed to the user and
implemented.
As suggested in [1], I've made some drastic changes in the
attached patch to take the comments (from Dean R., Tom L.)
into account. The idea is to limit to the bare minimum
the involvement of psql in sorting:
- the +/- syntax goes away
- the possibility of post-sorting the values through a backdoor
query goes away too, for both headers.
- the vertical order of the crosstab view is now driven solely by the
order in the query
- the order of the horizontal header can be optionally specified
by a column expected to contain an integer, with the syntax
\crosstabview colv colh:scolh [other cols]
which means "colh" will be sorted by "scolh".
It still defaults to whatever order "colh" comes in from the results
Concerning the optional "scolh", there are cases where it might pre-exist
naturally, such as a month number going in pair with a month name.
In other cases, a user may add it as a kind of "synthetic column"
by way of a window function, for example:
SELECT ...other columns...,
(row_number() over(order by something [order options]) as scolh
FROM...
Only the relative order of scolh values is taken into account, the value
itself
has no meaning for crosstabview.
- also NULLs are no longer excluded from headers, per Peter E.
comment in [2].
[1]
http://www.postgresql.org/message-id/3d513263-104b-41e3-b1c7-4ad4bd99c491@mm
[2] http://www.postgresql.org/message-id/56C4E344.6070903@gmx.net
Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite
В списке pgsql-hackers по дате отправления
От: David G. Johnston
Дата: