Re: Using unnest

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Using unnest
Date: 2009-07-25 20:44:35
Message-ID: 1248554675.6158.264.camel@jdavis
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, 2009-07-25 at 22:24 +0200, Thomas Kellerer wrote:
> I was trying to use information from the pg_stats view, when I remembered that 8.4 now has the cool
> unnest function.
>
> However I can't seem to get this to work with a column defined as anyarray.

It's generally hard to work with values of type anyarray. You have to
cast them to text and then to a normal array type.

For example:

select unnest(histogram_bounds::text::oid[]) from pg_stats where
tablename='pg_amop' and attname='amopopr';

Regards,
Jeff Davis

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2009-07-25 20:54:27 Re: Using unnest
Previous Message Thomas Kellerer 2009-07-25 20:24:36 Using unnest