Re: inserting multiple values in version 8.1.5 - Mailing list pgsql-general

From Greg Sabino Mullane
Subject Re: inserting multiple values in version 8.1.5
Date
Msg-id 4349c047969c93eb13597d89ac3a3464@biglumber.com
Whole thread Raw
In response to inserting multiple values in version 8.1.5  ("rkmr.em@gmail.com" <rkmr.em@gmail.com>)
List pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160


> I am trying to insert multiple values into a table like this.
> INSERT INTO tab_name (col1, col2) VALUES (val1, val2), (val3, val4)
...
> My production server runs in 8.1.5.
...
> What to do?

Upgrade to 8.2. :)

Seriously, you should upgrade to 8.1.8.

You can add multiple rows in one statement like this:

INSERT INTO tab_name (col1,col2)
SELECT val1, val2
UNION ALL
SELECT val3, val4;

- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200704031025
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iD8DBQFGEmRGvJuQZxSWSsgRA+dyAJ9buRgJdNfSK4pOWZQT+/bxZ27yEgCeO6AJ
sWpYA1cMbjHIziROLwrXwrM=
=Oeqk
-----END PGP SIGNATURE-----



pgsql-general by date:

Previous
From: "rkmr.em@gmail.com"
Date:
Subject: Re: inserting multiple values in version 8.1.5
Next
From: "A. Kretschmer"
Date:
Subject: Re: inserting multiple values in version 8.1.5