On Fri, 2007-08-10 at 15:36 +0200, Alain Roger wrote: > Hi, > > I would like to know what is the best way and fastest to insert into > PostgreSQL around 25.000 records (extracted from CSV file). > Should i use the standard pg_exec($dbconn, "insert into..."); for each > record ? > > thanks a lot, Let's say you have a table with an id and a value field. Where id is the key. You should be able to stack inserts like follows: INSERT INTO foo ( id, value ) VALUES ( 1, 'One' ), ( 2, 'Two' ), ( 3, 'threee' ); So with that in mind, you should cluster your inserts into groups of X inserts. I few hundred should make things a little quicker for you. Cheers, Rob. -- ........................................................... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ........................................................... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php