Inserting data in composite types

From: "Rodrigo Sakai" <rodrigo(dot)sakai(at)zanthus(dot)com(dot)br>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Inserting data in composite types
Date: 2006-11-13 12:37:51
Message-ID: 010101c70720$88605130$4700a8c0@TREEZANTHUS
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi, I have a question about how to insert data in composite types!

Imagine the exemple:

CREATE TYPE t_time AS (

a date,

b date

);

CREATE TABLE salary (

salary numeric(10,2),

t_date t_time

);

I know that if I want to insert data in the table SALARY I just have to do
like:

INSERT INTO salary VALUES (1000.00, '(2006/10/10, 2006/12/10)');

But if I have another table:

CREATE TABLE employee (

employee_id int,

name varchar(30),

emp_salary salary

)

How can I insert a single row in this table???

Thanks in advamce!

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2006-11-13 13:01:36 Overlap flags (Was: Re: Why overlaps is not working)
Previous Message Andrus 2006-11-13 12:24:52 Re: Why overlaps is not working