Re: insert multiple rows

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: insert multiple rows
Дата
Msg-id 1130802633.15018.38.camel@state.g2switchworks.com
обсуждение исходный текст
Ответ на Re: insert multiple rows  (David Fetter <david@fetter.org>)
Список pgsql-general
On Mon, 2005-10-31 at 17:13, David Fetter wrote:
> On Mon, Oct 31, 2005 at 06:06:14PM -0500, blackwater dev wrote:
> > In MySQL, I can insert multiple rows like this:
> >
> > insert into cars values(5, "toyota"),(5,"ford"), etc.
> >
> > How can I do something similiar in PostgreSQL?
>
> The similar thing in PostgreSQL is the COPY command (man 8 copy).

Note that for complex schemas, prepared queries may also be a good
choice.

Symantically, the closest thing to this for postgresql is doing:

begin;
insert ...
insert ...
insert ...
commit;


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

Предыдущее
От: "Rafael Montoya"
Дата:
Сообщение: Re: after insert or update or delete of col2
Следующее
От: Matthew Peter
Дата:
Сообщение: How may I keep prepended array items positive?