Re: dynamic crosstab

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: dynamic crosstab
Дата
Msg-id 20080219145608.GH7652@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: dynamic crosstab  (Joe Conway <mail@joeconway.com>)
Ответы Re: dynamic crosstab
Re: dynamic crosstab
Список pgsql-general
Joe Conway wrote:
> Erik Jones wrote:
>> See how postgres handles filling the NULLs for you?  What you'd really
>> want to do with this would be to define some functions for setting and
>> getting a person's answers to a given question or set of questions so
>> that you could implement some kind of data integrity with regards to
>> question ids and indices into the answers arrays such as in the example
>> above you'd want to prevent an entry at index 7 when there is no entry
>> in the questions table for question_id=7.
>
> It occurs to me that it shouldn't be terribly difficult to make an
> alternate version of crosstab() that returns an array rather than tuples
> (back when crosstab() was first written, Postgres didn't support NULL
> array elements). Is this worth considering for 8.4?

How about returning generic rows?  Is that possible?  It would be really
neat if you didn't have to specify the return type in the query that
invoked the crosstab.

I keep wondering if there's a way to "pivot" (transpose) a result set
defined by the standard.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

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

Предыдущее
От: "fdu.xiaojf@gmail.com"
Дата:
Сообщение: Re: questions about very large table and partitioning
Следующее
От: Joe Conway
Дата:
Сообщение: Re: dynamic crosstab