Insert multiple Rows

Поиск
Список
Период
Сортировка
От saintxplo@yahoo.com.ar (Saint X)
Тема Insert multiple Rows
Дата
Msg-id 6f079210.0303030838.21f184af@posting.google.com
обсуждение исходный текст
Ответы Re: Insert multiple Rows  ("Victor Yegorov" <viy@pirmabanka.lv>)
Re: Insert multiple Rows  (Oliver Elphick <olly@lfix.co.uk>)
Re: Insert multiple Rows  (Oleg Samoylov <olleg@telecom.mipt.ru>)
Список pgsql-sql
Hi, I have a program that need to send a Postgresql database a lot of
rows, i'm doing it using FOR an INSERT, something like this
for i = 0 to 1000
{insert into table(item1) VALUES (i);
}

And so on, as you can imagine these consume a lot of resources and
move so slowly, that's why I'm looking for a command to send more than
one row at the time, something like

insert into table (item1) values ('1' / '2' / '3' / '4' ... / '1000');

The data I want to send come from variables on the program, coping
local variables is fast so i can make my query on a variable with all
the data and then send just one query to the database.

I was looking on PostgreSQL documentation and find nothing,, I think
that what I'm looking for doesn't exist,, you are my last resource, it
possible to do what I want?

BTW: I found a command on Postgre to pass a file with all the info but
the database is not on local machine and its a little hard to send it
a file.


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

Предыдущее
От: Matt Gerginski
Дата:
Сообщение: complex query
Следующее
От: "Victor Yegorov"
Дата:
Сообщение: Re: complex query