Re: COPY with no WAL, in certain circumstances - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: COPY with no WAL, in certain circumstances
Date
Msg-id 200701061731.l06HVpg22109@momjian.us
Whole thread Raw
In response to Re: COPY with no WAL, in certain circumstances  ("Joshua D. Drake" <jd@commandprompt.com>)
Responses Re: COPY with no WAL, in certain circumstances  ("Joshua D. Drake" <jd@commandprompt.com>)
List pgsql-patches
Joshua D. Drake wrote:
> On Sat, 2007-01-06 at 11:05 -0500, Bruce Momjian wrote:
> > FYI, I am going need to add documentation in the COPY manual page or no
> > one will know about this performance enhancement.
>
> I have some questions:
>
> > > As discussed on -hackers, its possible to avoid writing any WAL at all
> > > for COPY in these circumstances:
> > >
> > > BEGIN;
> > >   CREATE TABLE foo..
> > >   COPY foo...
> > > COMMIT;
>
> What if I do this?
>
> BEGIN;
>    CREATE TABLE foo...
>    INSERT INTO foo VALUES ('1');
>    COPY foo...
>
> COMMIT;

On ABORT, the entire table disappears, as well as the INSERT, so I don't
see any problem.  I assume the INSERT is WAL logged.

--
  Bruce Momjian   bruce@momjian.us
  EnterpriseDB    http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

pgsql-patches by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: COPY with no WAL, in certain circumstances
Next
From: Tom Lane
Date:
Subject: Re: COPY with no WAL, in certain circumstances