pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Meskes <meskes@postgresql.org>
To: PostgreSQL Interfaces <pgsql-interfaces@postgresql.org>
Subject: Re: [INTERFACES] my problems with ecpg and arrays
Date: Fri, 12 Nov 1999 17:10:44 +0100
Message-ID: <19991112171044.A623@fam-meskes.de> (raw)

On Mon, Nov 08, 1999 at 10:39:12AM -0600, Coleman, Andrew wrote:
>   I'm having problems loading (insert into ..) a c array into a postgres
> table.
> I have tried all the variations on syntax I can think of, and searched for
> the
> answer... and either didn't find it or didn't recognize it..

I'm afraid you find a real problem here. I just didn't think about inserting
arrays. If you give ecpg an array of int it inserts every single value as
one int. That means:

insert into foo(bar) values(:intarray)

is equal to:

for (i=0;i<maxarray;i++)
	insert into foo(bar) values(:intarray[i])

How shall ecpg see that this time it is meant to insert the whole array?

Anyone with an idea?

Michael
-- 
Michael Meskes                         | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz    | Go Rhein Fire!
Tel.: (+49) 2431/72651                 | Use Debian GNU/Linux!
Email: Michael@Fam-Meskes.De           | Use PostgreSQL!



view thread (6+ messages)  latest in thread

Message-ID: <19991112171044.A623@fam-meskes.de>
Permalink:  ../19991112171044.A623@fam-meskes.de/
Also on:    postgresql.org/message-id/19991112171044.A623@fam-meskes.de

 · 

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: meskes@postgresql.org
  Subject: Re: [INTERFACES] my problems with ecpg and arrays
  In-Reply-To: <19991112171044.A623@fam-meskes.de>

* 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