Sascha Bohnenkamp <bohnenkamp (AT) mevisbreastcare (DOT) de> wrote:
Quote:
I want to use arrays to ease usage of some of our applications data.
I was able to figure out the OIDs of the primitive datatypes like
timestamp, integer etc. using the table pg_type.
But as soon as i use arrays I get OIDs from libpq which are not in
pg_type like 1115,1007,1022,1015
ok so where are the OIDs of arrays defined or how are they computed? |
If you are looking for a C header file, it is
<postgres>/include/server/catalog/pg_type.h
Unfortunately the only array type that has a #define for its OID is
INT4ARRAYOID.
The name of the type for int4[] is '_int4', for bytea[] it is '_bytea' etc.
You can query the table pg_catalog.pg_type for the information you want:
select oid from pg_catalog.pg_type where typname='_int4';
These OIDs are the same for all PostgreSQL servers.
I think that it is theoretically possible that they may change from one
PostgreSQL version to the other, but I don't think that this will ever
happen.
Yours,
Laurenz Albe