Skip site navigation (1) Skip section navigation (2)

Re: [INTERFACES] my problems with ecpg and arrays

From: Michael Meskes <michael(at)fam-meskes(dot)de>
To: "Coleman, Andrew" <colemana(at)navo(dot)navy(dot)mil>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: [INTERFACES] my problems with ecpg and arrays
Date: 1999-11-12 13:10:51
Message-ID: 19991112141051.A1962@fam-meskes.de (view raw or flat)
Thread:
Lists: pgsql-interfaces
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(at)Fam-Meskes(dot)De           | Use PostgreSQL!

In response to

pgsql-interfaces by date

Next:From: The Hermit HackerDate: 1999-11-12 13:37:54
Subject: RE: THE Postgres WEB SITE
Previous:From: Karel Zak - ZakkrDate: 1999-11-12 10:16:33
Subject: Re: [INTERFACES] Problem with C functions ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group