Re: insert multiple rows - Mailing list pgsql-general

From Scott Marlowe
Subject Re: insert multiple rows
Date
Msg-id 1130802633.15018.38.camel@state.g2switchworks.com
Whole thread Raw
In response to Re: insert multiple rows  (David Fetter <david@fetter.org>)
List pgsql-general
On Mon, 2005-10-31 at 17:13, David Fetter wrote:
> On Mon, Oct 31, 2005 at 06:06:14PM -0500, blackwater dev wrote:
> > In MySQL, I can insert multiple rows like this:
> >
> > insert into cars values(5, "toyota"),(5,"ford"), etc.
> >
> > How can I do something similiar in PostgreSQL?
>
> The similar thing in PostgreSQL is the COPY command (man 8 copy).

Note that for complex schemas, prepared queries may also be a good
choice.

Symantically, the closest thing to this for postgresql is doing:

begin;
insert ...
insert ...
insert ...
commit;


pgsql-general by date:

Previous
From: "Rafael Montoya"
Date:
Subject: Re: after insert or update or delete of col2
Next
From: Matthew Peter
Date:
Subject: How may I keep prepended array items positive?