Re: [BUGS] BUG #14521: pg_attribute.attndims = 0 for array column
В списке pgsql-bugs по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: [BUGS] BUG #14521: pg_attribute.attndims = 0 for array column |
| Дата | |
| Msg-id | 7447.1485961998@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | [BUGS] BUG #14521: pg_attribute.attndims = 0 for array column (krzysztof.heim@gmail.com) |
| Список | pgsql-bugs |
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
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера