Using unnest

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Using unnest
Date: 2009-07-25 20:24:36
Message-ID: h4fplo$tps$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

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.

So my query is:

select histogram_bounds
from pg_stats
where tablename = 'my_table'
and attname = 'col1';

Now I would like to get the elements of the histogram_bounds column as a set, and thought that
unnest would help me here, but the following:

select unnest(histogram_bounds)
from pg_stats
where tablename = 'my_table'
and attname = 'col1';

gives me the error

argument declared "anyarray" is not an array but type anyarray

I'm pretty sure I'm overlooking something obvious with regards to the unnest syntax, but what?

Thanks
Thomas

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Davis 2009-07-25 20:44:35 Re: Using unnest
Previous Message Kevin Kempter 2009-07-25 19:30:29 Re: where is pg_resetxlog ?