pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: List User <pglists@boscorama.com>
To: pgsql-interfaces@postgresql.org
Subject: PG 8.2.7, ECPG & Composite types..
Date: Wed, 30 Apr 2008 17:11:52 -0700
Message-ID: <48190AC8.5000005@boscorama.com> (raw)

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.



view thread (2+ messages)  latest in thread

Message-ID: <48190AC8.5000005@boscorama.com>
Permalink:  ../48190AC8.5000005@boscorama.com/
Also on:    postgresql.org/message-id/48190AC8.5000005@boscorama.com

 · 

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-interfaces@postgresql.org
  Cc: pglists@boscorama.com
  Subject: Re: PG 8.2.7, ECPG & Composite types..
  In-Reply-To: <48190AC8.5000005@boscorama.com>

* 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