From: | Michael Fuhr <mike(at)fuhr(dot)org> |
---|---|
To: | Chris Hoover <revoohc(at)gmail(dot)com> |
Cc: | "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org> |
Subject: | Re: create table problems |
Date: | 2006-07-26 23:13:16 |
Message-ID: | 20060726231316.GA61952@winnie.fuhr.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
On Wed, Jul 26, 2006 at 04:51:34PM -0400, Chris Hoover wrote:
> I am trying to create a table in my production system that has a foreign
> key into an existing table. However, this action is being blocked by
> transactions on that table, and is blocking any additional selects on that
> table.
>
> Why is this? The table is empty (being a create), so I don't understand
> what Postgresql is trying to do.
The transaction that's creating the new table wants to acquire an
AccessExclusiveLock on the referenced table, presumably so it can
alter that table to add referential integrity triggers. The
referenced table needs to have such triggers so it knows what
integrity checks to make when somebody tries to update or delete
its rows. Maybe one of the developers will confirm or refute.
--
Michael Fuhr
From | Date | Subject | |
---|---|---|---|
Next Message | Jeff Frost | 2006-07-27 06:53:13 | Re: Connection refused. Check that the hostname and port |
Previous Message | Thomas SMETS | 2006-07-26 21:44:46 | Re: DBA tasks |