Re: multiple row insertion - Mailing list pgsql-general

From Dawid Kuroczko
Subject Re: multiple row insertion
Date
Msg-id 758d5e7f0710040702n19c9a57ahe93394820a80c074@mail.gmail.com
Whole thread Raw
In response to Re: multiple row insertion  ("test tester" <test896@gmail.com>)
List pgsql-general
> On 10/4/07, test tester <test896@gmail.com> wrote:
> > i have version 8.1 and i want to know how to insert multiple rows in this
> version.

Please don't top post.

If you need this functionality, you should really upgrade.

In cases where you want to insert multiple rows in version 8.1, you
could use COPY command:
   http://www.postgresql.org/docs/8.1/interactive/sql-copy.html

You use it like this:
COPY cars FROM STDIN DELIMITER AS ',' CSV;
5,toyota
6,ford
\.

Or if you really need to use INSERT you could use such construct:

INSERT INTO cars SELECT 5, 'toyota' UNION ALL SELECT 6, 'ford'
  UNION ALL SELECT 7, 'bmw';

In short: really get the 8.2 version.  8.2 is compatible with earlier
versions and will be coming soon.

  Regards,
     Dawid
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: ERROR: variable not found in subplan target lists
Next
From: Miroslav Šulc
Date:
Subject: Re: ERROR: variable not found in subplan target lists