Composite types (or equivalent)

Поиск
Список
Период
Сортировка
Искать

Composite types (or equivalent)

От:
David Chippington <david@econostat.co.uk>
Дата:
Hello,

I have been trying to work out how to use composite types. 

All I want is to have a table column that contains a "struct" of existing 
postgres types. (Or ultimately an array of this type).

As I am using existing types I would have thought this was easy to achieve 
and the vague mentions of composite types indicate that this will do the job. 
However the documentation is sparse/non-existent.

Postgres will allow me to create a table that uses another table as a column 
type but it then seems impossible to insert any data.

Searching the archives I have found a couple of messages from people trying 
to do the same thing. One from two years ago had a reply that said composite 
types don't work.

Is this true ? If so why can I create a column that accepts another table as 
the type ?

If they cannot be used for this purpose what must I do ? Create my own type 
in a C library ?

I would appreciate any help on this subject. I'm not being lazy and have read 
the documentation extensively but it doesn't actually seem to say what can 
and can't be done.

Thanks

D. Chippington

 
 

FAQ