Re: inserting multiple values in version 8.1.5

From: "rkmr(dot)em(at)gmail(dot)com" <rkmr(dot)em(at)gmail(dot)com>
To: Chris <dmagick(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: inserting multiple values in version 8.1.5
Date: 2007-04-03 14:19:15
Message-ID: e04d2e90704030719p3af4db5cgef462ee7ce159ba4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I need to do like 1000 inserts periodically from a web app. Is it better to
do 1000 inserts or 1 insert with the all 1000 rows? Is using copy command
faster than inserts?
thanks

On 4/2/07, Chris <dmagick(at)gmail(dot)com> wrote:
>
> rkmr(dot)em(at)gmail(dot)com wrote:
> > Hi
> > I am trying to insert multiple values into a table like this.
> > INSERT INTO tab_name (col1, col2) VALUES (val1, val2), (val3, val4)
> >
> > This works in postgres version 8.2.1
> >
> > My production server runs in 8.1.5. It gives me
> > ERROR: syntax error at or near "," at character 35
>
> That came in at v8.2.
>
> You can't use it in 8.1.5.
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Greg Sabino Mullane 2007-04-03 14:31:30 Re: inserting multiple values in version 8.1.5
Previous Message Andrei Kovalevski 2007-04-03 14:04:07 Re: SQLConnect failure