Received: from localhost (uranus.hub.org [200.46.204.60]) by postgresql.org (Postfix) with ESMTP id 8A8C09FA22A for ; Mon, 13 Nov 2006 10:09:38 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.60]) (amavisd-new, port 10024) with ESMTP id 67481-05 for ; Mon, 13 Nov 2006 10:09:36 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.174]) by postgresql.org (Postfix) with ESMTP id 37FF29FA1E2 for ; Mon, 13 Nov 2006 10:09:35 -0400 (AST) Received: by ug-out-1314.google.com with SMTP id k3so908128ugf for ; Mon, 13 Nov 2006 06:09:35 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=DsPazGeuyoYNB01ODPbxbFOK/z9S84J0bmzgd7snbIFDySAKcv036smWgoj5MECV4ndhNchFOk7yk7c/u+dUyI9SgMNqA6ywDJidcmZQCvVbeFBWjZzxIqwPTJ0EYxKJdCsOrRKK8M1dihGU4OPPREdPlx/RZNyIsT8ikzeiCmk= Received: by 10.82.164.9 with SMTP id m9mr147795bue.1163426974804; Mon, 13 Nov 2006 06:09:34 -0800 (PST) Received: by 10.82.161.3 with HTTP; Mon, 13 Nov 2006 06:09:34 -0800 (PST) Message-ID: <1f30b80c0611130609s423d017aj1cb8c20b36c47007@mail.gmail.com> Date: Mon, 13 Nov 2006 19:09:34 +0500 From: imad To: rodrigo.sakai@zanthus.com.br Subject: Re: Inserting data in composite types! Cc: pgsql-sql@postgresql.org In-Reply-To: <00fc01c70720$7364c400$4700a8c0@TREEZANTHUS> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <00fc01c70720$7364c400$4700a8c0@TREEZANTHUS> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/128 X-Sequence-Number: 26780 I am able to do this thing with the following query: insert into employee (a, name, s) values(1, 'emp name', ((1, '(01/01/2000, 01/01/2000)'))); --Imad www.EnterpriseDB.com On 11/13/06, Rodrigo Sakai wrote: > > > > > 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! > >