Re: newbie sql question... - Mailing list pgsql-general

From scott.marlowe
Subject Re: newbie sql question...
Date
Msg-id Pine.LNX.4.33.0305271157480.12134-100000@css120.ihs.com
Whole thread Raw
In response to newbie sql question...  (Jason Ziegler <moo@zigfam.org>)
Responses Re: newbie sql question...  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
List pgsql-general
On Tue, 27 May 2003, Jason Ziegler wrote:

> Hello folks, I'm new to this list, and have been putting up with mysql
> for too long, so please forgive me for asking such a newbie question as
> this:
>
> I have a query that works in mysql:
> "INSERT INTO table1 ( id, column2, column3 ) VALUES ( '1', 'text
> stuff', 'text stuff' ), ( '2', 'more text', 'even more text')"
>
> When I try this in postgresql, it won't work:
> "INSERT INTO table1 ( 'id', 'column2', 'column3' ) VALUES ( '1', 'text
> stuff', 'text stuff' ), ( '2', 'more text', 'even more text')"

As others have pointed out, this won't work.

If you need to insert the two records as a single transaction, then do:

begin;
insert...1
insert...2
commit;

Also, there was some discussion on the hackers list a while back about
implementing this feature.  don't know if it's in CVS tip or if anyone's
even working on it, but it's on someone's radar dish, just way down on
their list of things to do I think.


pgsql-general by date:

Previous
From: Martin Marques
Date:
Subject: 7.3.3
Next
From: "scott.marlowe"
Date:
Subject: Re: Postgresql on SUN Server