Re: create table problems - Mailing list pgsql-admin

From Michael Fuhr
Subject Re: create table problems
Date
Msg-id 20060726231316.GA61952@winnie.fuhr.org
Whole thread Raw
In response to create table problems  ("Chris Hoover" <revoohc@gmail.com>)
List 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

pgsql-admin by date:

Previous
From: "Chris Hoover"
Date:
Subject: create table problems
Next
From: Omer Mustafa
Date:
Subject: Connection refused. Check that the hostname and port are correct