Re: newbie sql question...

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: Jason Ziegler <moo(at)zigfam(dot)org>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: newbie sql question...
Date: 2003-05-27 17:59:01
Message-ID: Pine.LNX.4.33.0305271157480.12134-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message scott.marlowe 2003-05-27 18:07:06 Re: Postgresql on SUN Server
Previous Message Martin Marques 2003-05-27 17:49:42 7.3.3