From: Rodrigo Sakai <rodrigo.sakai@zanthus.com.br>
To: pgsql-sql@postgresql.org
Subject: Inserting data in composite types!
Date: Mon, 13 Nov 2006 09:37:07 -0300
Message-ID: <00fc01c70720$7364c400$4700a8c0@TREEZANTHUS> (raw)
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!
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: rodrigo.sakai@zanthus.com.br
Subject: Re: Inserting data in composite types!
In-Reply-To: <00fc01c70720$7364c400$4700a8c0@TREEZANTHUS>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox