Re: pg_dump and inserts - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_dump and inserts
Date
Msg-id 13117.1043766522@sss.pgh.pa.us
Whole thread Raw
In response to pg_dump and inserts  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: pg_dump and inserts  (Bruce Momjian <pgman@candle.pha.pa.us>)
List 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 by date:

Previous
From: Justin Clift
Date:
Subject: Has everyone else here seen the "new" Database Open Test Suite by IBM?
Next
From: Bruno Wolff III
Date:
Subject: Re: SET NULL on NOT NULL field