Search Postgresql Archives

Re: accessing anyarray elements

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michael Glaesemann <grzm@xxxxxxxxxxxxxxx> writes:
> I'd like to be able to access individual elements of anyarray,  
> treating them as type anyelement to take advantage of the  
> polymorphism. Using pg_stats.histogram_bounds as a convenient example  
> of an anyelement array, here's an example of the issue I'm running into.

The problem with histogram_bounds is that there isn't any way to
infer an element type for it in the abstract, and thus also no way to
know what type anyelement is.  When looking at an individual row you can
know that it must have the type of the associated column and explain
that to the parser via an explicit cast, but there's pretty much no hope
of having that happen automagically.

There are a few other problems, like array columns --- the contents of
pg_statistic for them is actually an array of arrays, which simply
has not got a representation in our type system.

So you're pretty much out of luck.  I think the only meaningful thing
you can do with it in SQL is cast to text.

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux