On Wed, Jun 27, 2012 at 7:26 PM, David Johnston <pol...@yahoo.com> wrote:
> On Jun 27, 2012, at 21:07, Andreas <maps...@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