Re: Inserting data in composite types!

From: Markus Schiltknecht <markus(at)bluegap(dot)ch>
To: rodrigo(dot)sakai(at)zanthus(dot)com(dot)br
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Inserting data in composite types!
Date: 2006-11-13 12:28:03
Message-ID: 455864D3.4020904@bluegap.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Rodrigo Sakai 2006-11-13 12:37:07 Inserting data in composite types!
Previous Message Marko Rihtar 2006-11-13 10:36:05 SQL - update table problem...