Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id A08CA63408E for ; Thu, 22 Oct 2009 15:30:00 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 09074-01-8 for ; Thu, 22 Oct 2009 18:29:47 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 352E6636341 for ; Thu, 22 Oct 2009 15:28:39 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id n9MISbdp011872; Thu, 22 Oct 2009 14:28:37 -0400 (EDT) To: Gary Chambers cc: pgsql-sql@postgresql.org Subject: Re: Assigning Values to Composite Types In-reply-to: <302670f20910221031v6cc61b5bq27accbf7d928d024@mail.gmail.com> References: <302670f20910221031v6cc61b5bq27accbf7d928d024@mail.gmail.com> Comments: In-reply-to Gary Chambers message dated "Thu, 22 Oct 2009 13:31:11 -0400" Date: Thu, 22 Oct 2009 14:28:37 -0400 Message-ID: <11871.1256236117@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.817 tagged_above=-10 required=5 tests=AWL=-0.707, BAYES_05=-1.11 X-Spam-Level: X-Archive-Number: 200910/112 X-Sequence-Number: 33311 Gary Chambers writes: > /* Here is where I am stuck trying to fill data > I've tried: > data.term_count.coord_type := S; > (data.term_count).coord_type := S; > data.(term_count.coord_type) := S; > */ I'm afraid plpgsql isn't tremendously bright about such cases. If you have all the values available at once, though, it seems like you should be able to do data.term_count := row(this, that, the_other); An explicit cast of the row() construct to the target column's type might be a good idea --- I think it would work without, but probably not with good performance. regards, tom lane