Re: rotate psql output

Поиск
Список
Период
Сортировка
От Ben Carbery
Тема Re: rotate psql output
Дата
Msg-id AANLkTim4tLpeauaZDD3_ypWLi+7KGs6Wur1fmZ9vY5BN@mail.gmail.com
обсуждение исходный текст
Ответ на Re: rotate psql output  (Vincenzo Romano <vincenzo.romano@notorand.it>)
Ответы Re: rotate psql output  (Vincenzo Romano <vincenzo.romano@notorand.it>)
Список pgsql-general

On Thu, Sep 30, 2010 at 9:36 PM, Vincenzo Romano <vincenzo.romano@notorand.it> wrote:
2010/9/30 Raymond O'Donnell <rod@iol.ie>:
> On 30/09/2010 12:17, Ben Carbery wrote:
> Googling on "sql swap rows columns" found this:
>
> http://stackoverflow.com/questions/584232/t-sql-how-to-swap-rows-and-columns
>
> ...which you'll be able to adapt.

We also have the fantastic crosstab in tablefunc module (see chapter
F.36.1.4 for v9.0.0)

--
Vincenzo Romano at NotOrAnd Information Technologies
Software Hardware Networking Training Support Security
--
NON QVIETIS MARIBVS NAVTA PERITVS


..but these seem to be more pivot table functions that alter the data, rather than displaying it differently. Not sure if this method is adaptable but I may have a go.

To me swapping would be better suited as an option to psql. After all, calling columns 'columns' in sql is aribtrary - they could just as easily have been called rows or something else, so there's no reason for the output to be fixed that way. Although that would chew a lot of memory if you have a lot of records as you would need to read every record before formatting..and I guess that explains why it hasn't been done.

No idea if this can be done in other clients!

В списке pgsql-general по дате отправления:

Предыдущее
От: Vincenzo Romano
Дата:
Сообщение: Re: rotate psql output
Следующее
От: Vincenzo Romano
Дата:
Сообщение: Re: rotate psql output