Re: newbie sql question...

Поиск
Список
Период
Сортировка
От scott.marlowe
Тема Re: newbie sql question...
Дата
Msg-id Pine.LNX.4.33.0305271157480.12134-100000@css120.ihs.com
обсуждение исходный текст
Ответ на newbie sql question...  (Jason Ziegler <moo@zigfam.org>)
Ответы Re: newbie sql question...  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Список 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 по дате отправления:

Предыдущее
От: Martin Marques
Дата:
Сообщение: 7.3.3
Следующее
От: "scott.marlowe"
Дата:
Сообщение: Re: Postgresql on SUN Server