dbTalk Databases Forums  

Array interface

comp.databases.postgresql comp.databases.postgresql


Discuss Array interface in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mladen Gogala
 
Posts: n/a

Default Array interface - 08-25-2010 , 05:11 PM






Is there anything in Postgres that would allow me to insert a whole bunch
of rows at once, with a single insert or do a prefetch? Here is my
problem:


my $dbh = DBI->connect("dbi:Oracle:$db", $username, $passwd)
Quote:
| die($DBI::errstr . "\n");
$dbh->{AutoCommit} = 0;
$dbh->{RaiseError} = 1;
$dbh->{ora_check_sql} = 0;
$dbh->{RowCacheSize} = 1024;
$dbh->{ora_array_chunk_size} = 1024;
return ($dbh);

This snippet tells Oracle to try fetching 1024 rows at once. I can also
do array binds and array executions, to send multiple rows to be
processed by a single insert. Is there anything even remotely similar
in the Postgres world? I was unable to find anything in the DBI driver
documentation, I wonder whether there are any parameters to twist, either
on the linux itself, or in the postgres.conf, that could help me with
that.


--
http://mgogala.byethost5.com

Reply With Quote
  #2  
Old   
Thomas Kellerer
 
Posts: n/a

Default Re: Array interface - 08-26-2010 , 01:30 AM






Mladen Gogala, 26.08.2010 00:11:
Quote:
Is there anything in Postgres that would allow me to insert a whole bunch
of rows at once, with a single insert
INSERT INTO my_table
(col1, col2, col3)
VALUES
(1,2,3),
(4,5,6),
(7,8,9);

will insert three rows.

Regards
Thomas

Reply With Quote
  #3  
Old   
Mladen Gogala
 
Posts: n/a

Default Re: Array interface - 08-26-2010 , 02:42 PM



On Thu, 26 Aug 2010 08:30:05 +0200, Thomas Kellerer wrote:

Quote:
Mladen Gogala, 26.08.2010 00:11:
Is there anything in Postgres that would allow me to insert a whole
bunch of rows at once, with a single insert

INSERT INTO my_table
(col1, col2, col3)
VALUES
(1,2,3),
(4,5,6),
(7,8,9);

will insert three rows.

Regards
Thomas
Excellent. I will test the array bind and see whether there is any
difference in performance.



--
http://mgogala.byethost5.com

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.