pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Markus Schiltknecht <markus@bluegap.ch>
To: rodrigo.sakai@zanthus.com.br
Cc: pgsql-sql@postgresql.org
Subject: Re: Inserting data in composite types!
Date: Mon, 13 Nov 2006 13:28:03 +0100
Message-ID: <455864D3.4020904@bluegap.ch> (raw)
In-Reply-To: <00fc01c70720$7364c400$4700a8c0@TREEZANTHUS>
References: <00fc01c70720$7364c400$4700a8c0@TREEZANTHUS>

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



view thread (4+ messages)  latest in thread

Message-ID: <455864D3.4020904@bluegap.ch>
Permalink:  ../455864D3.4020904@bluegap.ch/
Also on:    postgresql.org/message-id/455864D3.4020904@bluegap.ch

 · 

reply

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: markus@bluegap.ch, rodrigo.sakai@zanthus.com.br
  Subject: Re: Inserting data in composite types!
  In-Reply-To: <455864D3.4020904@bluegap.ch>

* 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