Search Postgresql Archives

Re: programmatically retrieve details of a custom Postgres type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Konstantin Izmailov <pgfizm@xxxxxxxxx> writes:
> I was unable to find how to get column names, sizes and types for a given
> composite type.

For a composite type, pg_type.typrelid links to pg_class and pg_attribute
entries that work much like a table.  For instance,

# select a.attname, a.atttypid::regtype from pg_type t left join pg_attribute a on t.typrelid = a.attrelid where typname = 'complex' order by attnum; 
 attname |     atttypid     
---------+------------------
 r       | double precision
 i       | double precision
(2 rows)

			regards, tom lane






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux