Array type confusion

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Array type confusion
Дата
Msg-id Pine.LNX.4.21.0007051715350.347-100000@localhost.localdomain
обсуждение исходный текст
Ответы Re: Array type confusion  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
The question is how to determine when a type is an array type (and not
using the leading-underscore convention). A comment in pg_type.h says:

/** typelem is 0 if this is not an array type.  If this is an array* type, typelem is the OID of the type of the
elementsof the array* (it identifies another row in Table pg_type).*/
 

The reverse seems to be false. If typelem is not 0, then the type is not
necessarily an array type. For example, the typelem entries of text,
bpchar, and name point to char (the single-byte variant), while box and
lseg claim to be arrays of "point".

How should this be handled in the context of formatting the types for
reconsumption?


Appendix: The complete list of not-really-array types that have typelem
set is:

bytea        => char
name        => char
int2vector    => int2
text        => char
oidvector    => oid
point        => float8
lseg        => point
path        => point
box        => point
filename    => char
line        => point
unknown        => char
bpchar        => char
varchar        => char


-- 
Peter Eisentraut                  Sernanders väg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: fcntl(F_SETLK)
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: zlib for pg_dump