Re: Inserting data in composite types! - Mailing list pgsql-sql

From Markus Schiltknecht
Subject Re: Inserting data in composite types!
Date
Msg-id 455864D3.4020904@bluegap.ch
Whole thread Raw
In response to Inserting data in composite types!  ("Rodrigo Sakai" <rodrigo.sakai@zanthus.com.br>)
List pgsql-sql
Hi,

Rodrigo Sakai wrote:
> How can I insert a single row in this table???

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


BTW: are you sure you don't want to use foreign keys instead? Something 
like:

CREATE TABLE salaries (  id SERIAL PRIMARY KEY,  salary numeric(10,2) NOT NULL,  t_date t_time NOT NULL
);

CREATE TABLE employee (  employee_id SERIAL PRIMARY KEY,  name TEXT NOT NULL,  salary INT NOT NULL REFERENCES
salaries(id)
);

Regards

Markus


pgsql-sql by date:

Previous
From: "Rodrigo Sakai"
Date:
Subject: Inserting data in composite types!
Next
From: Shane Ambler
Date:
Subject: Re: Inserting data in composite types!