Search Postgresql Archives

Re: multiple row insertion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



am  Thu, dem 04.10.2007, um 18:47:01 +0500 mailte test tester folgendes:
> 
> 
> On 10/4/07, test tester <test896@xxxxxxxxx> wrote:
> 
>     i have version 8.1 and i want to know how to insert multiple rows in this
>     version.

Please no silly top post.

You can insert multiple values with one insert with multiple select and
UNION like this example:

test=*# truncate foo;
TRUNCATE TABLE
test=*# select * from foo;
 w
---
(0 rows)

test=*# insert into foo  select 'foo1' union select 'foo2' union select 'foo3';
INSERT 0 3
test=*# select * from foo;
  w
------
 foo1
 foo2
 foo3
(3 rows)



Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux