Krzysztof Heim <krzysztof.heim@gmail.com> writes:
> If I may ask, what is then the best way of checking if column is array.
The standard way for C code is to use this macro from lsyscache.h:
#define type_is_array(typid) (get_element_type(typid) != InvalidOid)
or depending on what you're doing, you might want these semantics:
/* type_is_array_domain accepts both plain arrays and domains over arrays */
#define type_is_array_domain(typid) (get_base_element_type(typid) != InvalidOid)
or then again, you might just want to check if the type has nonzero
typelem --- that would be the appropriate thing if you want to see
whether the type is subscriptable.
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs