pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Meskes <michael@fam-meskes.de>
To: Coleman, Andrew <colemana@navo.navy.mil>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: [INTERFACES] my problems with ecpg and arrays
Date: Fri, 12 Nov 1999 14:10:51 +0100
Message-ID: <19991112141051.A1962@fam-meskes.de> (raw)
In-Reply-To: <78166D547FD9D2119FA700805F9FA971C0E9A0@navont3.navo.navy.mil>
References: <78166D547FD9D2119FA700805F9FA971C0E9A0@navont3.navo.navy.mil>

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: <19991112141051.A1962@fam-meskes.de>
Permalink:  ../19991112141051.A1962@fam-meskes.de/
Also on:    postgresql.org/message-id/19991112141051.A1962@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-interfaces@postgresql.org
  Cc: michael@fam-meskes.de, colemana@navo.navy.mil
  Subject: Re: [INTERFACES] my problems with ecpg and arrays
  In-Reply-To: <19991112141051.A1962@fam-meskes.de>
  References: <78166D547FD9D2119FA700805F9FA971C0E9A0@navont3.navo.navy.mil> <19991112141051.A1962@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