Re: insert with multiple targetLists

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: insert with multiple targetLists
Дата
Msg-id 200206020553.g525rBK11268@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: insert with multiple targetLists  ("Rod Taylor" <rbt@zort.ca>)
Список pgsql-hackers
Rod Taylor wrote:
> >     INSERT INTO t1 (c1) VALUES (1), (2);
> >
> >     would be executed in a similar fashion to:
> >
> >     INSERT INTO t1 (c1) VALUES (1);
> >     INSERT INTO t1 (c1) VALUES (2);
> >
> > Does this sound reasonable?


Sounds good to me.

> I debated doing the above too.  In fact, I had a partial
> implementation at one point.
> 
> However, the resulting purpose of allowing such a construct is to
> enable the speeds copy achieves with the variation that is found in an
> insert. ...

I thought the purpose of the item was merely for compatibility with
other databases that support this syntax.  I don't think it will ever
match COPY performance, and I don't think stuffing a huge INSERT into
the database rather than COPY rows will ever be a preferred method.

I only see VALUES used by INSERT so if you can think of a clean way to
make that work as multiple INSERTs, I think it would be a good idea. 
Hopefully, it will be one localized change, and we can remove it if we
ever want to support VALUES in more complex situations, as Tom
mentioned.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Laszlo Hornyak
Дата:
Сообщение: coniguration api
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Search from newer tuples first, vs older tuples first?