Re: [INTERFACES] my problems with ecpg and arrays

Поиск
Список
Период
Сортировка
От Michael Meskes
Тема Re: [INTERFACES] my problems with ecpg and arrays
Дата
Msg-id 19991112171044.A623@fam-meskes.de
обсуждение исходный текст
Ответ на [INTERFACES] my problems with ecpg and arrays  ("Coleman, Andrew" <colemana@navo.navy.mil>)
Список 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@Fam-Meskes.De           | Use PostgreSQL!


В списке pgsql-interfaces по дате отправления:

Предыдущее
От: "Sergio A. Kessler"
Дата:
Сообщение: Re: [INTERFACES] THE Postgres WEB SITE
Следующее
От: Dorin Grunberg
Дата:
Сообщение: Problem with Large Objects