Re: Using multi-row technique with COPY

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Using multi-row technique with COPY
Date: 2005-11-29 19:50:35
Message-ID: 200511291950.jATJoZ513641@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > One idea for default behavior would be to use EXCLUSIVE when the table
> > is zero size. I think that would do pg_dump and most of the user cases,
> > and of course users could override the default by using a keyword. We
> > could emit a NOTICE if an an exclusive lock is used without an EXCLUSIVE
> > keyword. One problem I see is that there is no way to insure zero size
> > without a lock that blocks other writers. Is that reliable?
>
> No, and if you try to upgrade your lock after checking, you create a
> deadlock problem.
>
> Something that would probably be reasonable, and require *no* weird new
> syntax, is to shortcut in a COPY into a table created in the current
> transaction. I believe we still keep a flag in the relcache indicating
> whether that's the case ...

So if the table is created in the current transaction, we don't log?
Yes, I guess, but do we want to propogate that into pg_dump output? I
would think not.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-11-29 19:56:39 Re: Using multi-row technique with COPY
Previous Message Tom Lane 2005-11-29 19:30:28 Re: Using multi-row technique with COPY