Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id B442A2E004A for ; Wed, 30 Apr 2008 21:31:26 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 45499-05 for ; Wed, 30 Apr 2008 21:31:16 -0300 (ADT) Received: from mx1.hub.org (mx1.hub.org [200.46.208.106]) by developer.postgresql.org (Postfix) with ESMTP id 1BD262E0041 for ; Wed, 30 Apr 2008 21:31:24 -0300 (ADT) X-Greylist: delayed 00:14:19.627772 by SQLgrey-1.7.5 Received: from sunrise.mainecoon.com (sunrise.mainecoon.com [63.192.96.4]) by mx1.hub.org (Postfix) with ESMTP id 7419EB0779C for ; Wed, 30 Apr 2008 21:31:16 -0300 (ADT) Received: from [10.1.1.2] (fw.boscorama.com [209.204.170.12]) by sunrise.mainecoon.com (8.14.1/8.14.1) with ESMTP id m410Br7J004005 for ; Wed, 30 Apr 2008 17:11:53 -0700 Message-ID: <48190AC8.5000005@boscorama.com> Date: Wed, 30 Apr 2008 17:11:52 -0700 From: List User User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050920 Mnenhy/0.7.4.0 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: PG 8.2.7, ECPG & Composite types.. Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200804/13 X-Sequence-Number: 6724 Hey folks, Running PG 8.2.7 and we have decided to use composite types. However, we are coming up against an issue with ECPG when trying to insert data into tables using composite types. It's almost like ECPG doesn't allow composite types. We are novices in this regard so please be gentle. :-) Here's something really basic that we can get working in psql but not in ECPG: create type C_AMT as ( amt float8, iso integer ); create table items ( itemNum serial8 primary key, name varchar(127), price C_AMT, stock integer ); and in ECPG we have tried various things which either end up with a mismatch between column count & value count; or generate an error where the values for the embedded composite type have been melded together as a text string and telling us that the resulting string is an invalid floating point value. Following is an example of the latter error: exec sql insert into items ( name, price.amt, price.iso, stock ) values ( 'Test Item', 99.2, 1, 101 ); Similarly, exec sql insert into items ( name, price, stock ) values ( 'Test Item', ( 99.2, 1 ), 101 ); Are we chasing a dream or just misguided? Any help would be greatly appreciated. Fred.