Обсуждение: Multiple insertion

Поиск
Список
Период
Сортировка

Multiple insertion

От
Miguel
Дата:
I need make multiple insertions in a new database under Postgresql 8.0 .
I will be satisfy if I can make this operation in a once operation. I
will be satisfied if I can make this operation in a once . I try use
INSERT TABLE ... VALUES (..), VALUES ( ); but in this way it doesn't
work. I am working in my degree project using java 5 and Postgresql 8.0.3 .
I hope if somebody may be explain if it is possible
Miguel Manzano

Re: Multiple insertion

От
Bruce Momjian
Дата:
Miguel wrote:
> I need make multiple insertions in a new database under Postgresql 8.0 .
> I will be satisfy if I can make this operation in a once operation. I
> will be satisfied if I can make this operation in a once . I try use
> INSERT TABLE ... VALUES (..), VALUES ( ); but in this way it doesn't
> work. I am working in my degree project using java 5 and Postgresql 8.0.3 .
> I hope if somebody may be explain if it is possible

It is not possible but is on the TODO list.  You can put multipe inserts
in a single transaction if you want.

--
  Bruce Momjian   http://candle.pha.pa.us
  SRA OSS, Inc.   http://www.sraoss.com

  + If your life is a hard drive, Christ can be your backup. +

Re: Multiple insertion

От
shakil tanvir
Дата:
Dear Bruce,

Following excerpt from a previous posting
to this group should help you:

test=# create table tbl1 (x int, y int);
CREATE TABLE
test=# insert into tbl1 select 1,1 union select 2,2 union select 3,3;
INSERT 0 3
test=# select * from tbl1 ;
x | y
---+---
1 | 1
2 | 2
3 | 3
(3 rows)

Regards,

Shakil

Bruce Momjian <pgman@candle.pha.pa.us> wrote:
Miguel wrote:
> I need make multiple insertions in a new database under Postgresql 8.0 .
> I will be satisfy if I can make this operation in a once operation. I
> will be satisfied if I can make this operation in a once . I try use
> INSERT TABLE ... VALUES (..), VALUES ( ); but in this way it doesn't
> work. I am working in my degree project using java 5 and Postgres ql 8.0.3 .
> I hope if somebody may be explain if it is possible

It is not possible but is on the TODO list. You can put multipe inserts
in a single transaction if you want.

--
Bruce Momjian http://candle.pha.pa.us
SRA OSS, Inc. http://www.sraoss.com

+ If your life is a hard drive, Christ can be your backup. +

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings


Yahoo! Mail
Use Photomail to share photos without annoying attachments.