Re: CREATE TABLE (with INHERITS) and ACCESS EXCLUSIVE locks

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Thomas F(dot) O'Connell" <tfo(at)sitening(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: CREATE TABLE (with INHERITS) and ACCESS EXCLUSIVE locks
Date: 2006-04-04 21:53:01
Message-ID: 14860.1144187581@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Thomas F. O'Connell" <tfo(at)sitening(dot)com> writes:
> As for how this plays out in the real world, a pg_dumpall will start
> and run for a few hours. Sometime during that, this function might
> get called. When it does, an ACCESS EXCLUSIVE lock is held against
> the table identified as t13, here directly referenced only as a
> FOREIGN KEY.

It's the addition of a foreign key constraint that's biting you. That
requires installing triggers on the pre-existing table (t13, also t14
in your example), and that requires an exclusive lock.

Since we don't currently allow any ON SELECT triggers, it's possible
that adding a trigger could be downgraded to just ExclusiveLock (which
wouldn't conflict with pg_dump's AccessShareLock), but I can't say that
I'm enthusiastic about that idea.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Edmund Bacon 2006-04-04 21:58:06 Re: Spurious rows returned with left join?
Previous Message Tom Lane 2006-04-04 21:30:58 Re: Spurious rows returned with left join?