Re: How to solve the old bool attributes vs pivoting issue?

Поиск
Список
Период
Сортировка
От Samuel Gendler
Тема Re: How to solve the old bool attributes vs pivoting issue?
Дата
Msg-id CAEV0TzAB8bqGky1mWX5mOUjpQ53suOg1gYgDiCY0Zc=9tDtQXQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to solve the old bool attributes vs pivoting issue?  (David Johnston <polobo@yahoo.com>)
Список pgsql-sql


On Wed, Jun 27, 2012 at 7:26 PM, David Johnston <polobo@yahoo.com> wrote:
On Jun 27, 2012, at 21:07, Andreas <maps.on@gmx.net> wrote:


You should look and see whether the hstore contrib module will meet your needs.

http://www.postgresql.org/docs/9.1/interactive/hstore.html


hstore is certainly an option, as are the crosstab functions in the tablefunc contrib module, which can definitely do what you are looking for.  The 2-query form of the function would allow you to generate a resultset that gives true/false/null for every possible attribute without having to have a column for every attribute, yet you'd have all of the convenience of a normalized schema representing attributes when doing other queries. There are a fair number of threads about using the crosstab functions in the archives of this list.

--sam

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

Предыдущее
От: David Johnston
Дата:
Сообщение: Re: How to solve the old bool attributes vs pivoting issue?
Следующее
От: George Woodring
Дата:
Сообщение: must appear in GROUP by clause issue