Re: pg_dump and inserts

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg_dump and inserts
Дата
Msg-id 13117.1043766522@sss.pgh.pa.us
обсуждение исходный текст
Ответ на pg_dump and inserts  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: pg_dump and inserts  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> I just checked and pg_dump -d _doesn't_ place the INSERT's in a
> transsaction.  Seems it should,

I think this is a bad idea.  If one were after speed, one would have
used the COPY format in the first place.  If one uses INSERTs, there
may be a reason for it --- like, say, wanting each row insertion to
succeed or fail independently.  Put a begin/end around it, and you
lose that.

> and perhaps add a:
>     SET autocommit TO 'on'
> as well.

This is probably a good idea, since pg_dump scripts effectively assume
that anyway.

> Of course, that SET would fail when restoring to prior
> releases,

Irrelevant; current pg_dump scripts already issue a SET that pre-7.3
servers won't recognize (search_path).  A failed SET is harmless anyway,
or should be.  (What we really need is for someone to fix pg_restore to
not abort on SQL errors...)
        regards, tom lane


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

Предыдущее
От: Justin Clift
Дата:
Сообщение: Has everyone else here seen the "new" Database Open Test Suite by IBM?
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: SET NULL on NOT NULL field