From: Michael Fuhr <mike@fuhr.org>
To: Chris Hoover <revoohc@gmail.com>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: create table problems
Date: Wed, 26 Jul 2006 17:13:16 -0600
Message-ID: <20060726231316.GA61952@winnie.fuhr.org> (raw)
In-Reply-To: <1d219a6f0607261351w2a743022t65e9d026b89dffdf@mail.gmail.com>
References: <1d219a6f0607261351w2a743022t65e9d026b89dffdf@mail.gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: mike@fuhr.org, revoohc@gmail.com
Subject: Re: create table problems
In-Reply-To: <20060726231316.GA61952@winnie.fuhr.org>
References: <1d219a6f0607261351w2a743022t65e9d026b89dffdf@mail.gmail.com> <20060726231316.GA61952@winnie.fuhr.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox