Re: pg_dump and inserts

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_dump and inserts
Date: 2003-01-28 15:08:42
Message-ID: 13117.1043766522@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tony Grant 2003-01-28 15:46:36 Re: list server problems?
Previous Message William WAISSE 2003-01-28 14:07:19 Re: list server problems?