Re: Best way to import data in postgresl (not "COPY")

From: "Sufficool, Stanley" <ssufficool(at)sbcounty(dot)gov>
To: "Denis BUCHER" <dbucherml(at)hsolutions(dot)ch>
Cc: <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: Best way to import data in postgresl (not "COPY")
Date: 2009-07-23 00:06:42
Message-ID: C2F174F99918D54CA2A96E57C5079B6F015C4230@sbc-exmsg2.sbcounty.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

You could group the insert into batches using:

INSERT INTO table (field1, field2)
Select value1, value2
Union all Select value1, value2
Union all Select value1, value2
Union all Select value1, value2
Union all Select value1, value2
Union all Select value1, value2;

> -----Original Message-----
> From: pgsql-odbc-owner(at)postgresql(dot)org
> [mailto:pgsql-odbc-owner(at)postgresql(dot)org] On Behalf Of Denis BUCHER
> Sent: Wednesday, July 22, 2009 11:31 AM
> To: pgsql-odbc(at)postgresql(dot)org
> Subject: [ODBC] Best way to import data in postgresl (not "COPY")
>
>
> Hello,
>
> I have a system that must each day import lots of data from
> another one. Our system is in postgresql and we connect to
> the other via ODBC.
>
> Currently we do something like :
>
> SELECT ... FROM ODBC source
> foreach row {
> INSERT INTO postgresql
> }
>
> The problem is that this method is very slow...
>
> More especially that for each row we do :
> field1 = ...
> field2 = ...
> And then
> $sql_insert = "INSERT ..." . field1 ....
>
>
> Does someone has a better suggestion ?
>
> Thanks a lot in advance !
>
> Denis
>
> --
> Sent via pgsql-odbc mailing list (pgsql-odbc(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-odbc
>

In response to

Browse pgsql-odbc by date

  From Date Subject
Next Message fatmijumar fatmijumar 2009-07-23 14:46:59 possible bug with casting of STDDEV arguments
Previous Message Jeff Crumbley 2009-07-22 19:39:36 Re: Best way to import data in postgresl (not "COPY")