Search Postgresql Archives

how to add array of objects to a record

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

 



Hi list,

Can I add an array of object to a record?

For example if I have a class (or type) phone_number:

create type phone_number as(
name char(20),
caption char(50),
ph_num char(25));

and I would like associate several (unknown number, a priori) phone numbers
to a record "persons"
can I create a table like this:

create table persons(
id integer,
first_name char(50),
family_name char(50),
phone_numbers phone_number[])

and how I have to write the insert and the select queries to put and get
the array of phone numbers?

thank you

Domenico


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

[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 Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux