Re: ADD FOREIGN KEY - Mailing list pgsql-hackers

From Manfred Koizar
Subject Re: ADD FOREIGN KEY
Date
Msg-id 8m5mnvg8rtttte9nf1uhe2uhgn6cl04eik@4ax.com
Whole thread Raw
In response to Re: ADD FOREIGN KEY  (Christopher Browne <cbbrowne@acm.org>)
Responses Re: ADD FOREIGN KEY
List pgsql-hackers
On Tue, 30 Sep 2003 08:00:07 -0400, Christopher Browne
<cbbrowne@acm.org> wrote:
>I would be pretty "game" for a near-single-user-mode approach that
>would turn off some of the usual functionality that we knew we didn't
>need because the data source was an already-committed-and-FK-checked
>set of data.

Single user mode is a good idea, IMHO.  But it should only make sure
that there is not more than one user connected to the database (or to
the postmaster).  Everything else should depend on special GUC
variables that are only settable in single user mode:

db=> SET disable-fk-verification = true;
ERROR: "disable-fk-verification" can only be set in single user mode
db=> SET SINGLE USER MODE ON;
ERROR: permission denied
HINT: Must be superuser or owner of database "db".
db=> \c - dbo
You are now connected as new user "dbo".
db=> SET SINGLE USER MODE ON;
ERROR: cannot enter single user mode
HINT: You are not the only user connected to database "db".
-- after other users have logged out ...
db=> SET SINGLE USER MODE ON;
SET
db=> SET disable-fk-verification = true;
SET

Single user mode would also help in several cases where now a
standalone backend is required ...

ServusManfred


pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: Thoughts on maintaining 7.3
Next
From: David Blasby
Date:
Subject: query plan different for "SELECT ..." and "DECLARE CURSOR ..."?