Re: getting datatype of array elements - Mailing list pgsql-general

From Joe Conway
Subject Re: getting datatype of array elements
Date
Msg-id 3DFA9C57.3060904@joeconway.com
Whole thread Raw
In response to getting datatype of array elements  (Moritz Sinn <moritz@freesources.org>)
List pgsql-general
Moritz Sinn wrote:
> hi,
>
> with the following statement, i get the datatype of a column with help of
> its name and the tableoid:
>
> SELECT typname FROM pg_attribute LEFT JOIN pg_type ON atttypid=typelem
> WHERE attrelid=18210 AND attname='email';
>
> but if the columns datatyp is an array, that doesn't work.
> i'd like to get the basic datatype (the datatype of the array elements) then.

See typelem:
http://www.us.postgresql.org/users-lounge/docs/7.3/postgres/catalog-pg-type.html

HTH,

Joe



pgsql-general by date:

Previous
From: Moritz Sinn
Date:
Subject: getting datatype of array elements
Next
From: Egyud Csaba
Date:
Subject: Where are my tables physically in the fs?