Re: changing MyDatabaseId - Mailing list pgsql-hackers

From Markus Wanner
Subject Re: changing MyDatabaseId
Date
Msg-id 4CE3B559.8030708@bluegap.ch
Whole thread Raw
In response to Re: changing MyDatabaseId  (Andres Freund <andres@anarazel.de>)
Responses Re: changing MyDatabaseId
List pgsql-hackers
Andreas,

On 11/17/2010 11:38 AM, Andres Freund wrote:
> Well, one could optimize most of the resetting away if the the old 
> MyDatabaseId and the new one are the same  - an optimization which is hardly 
> possible with forking new backends.

Uh? Why not simply re-use the same backend, then? Or do you think of
re-connecting to the same database as a way to reset your connection?

> Also I think it could lower the impact due locking the procarray an related 
> areas.

That may be, yes. But as pointed out by Tom and Alvaro, you'd have to
adhere to a compatible sequence of changes to shared memory to avoid
race conditions. That possibly requires using a very similar locking
sequence as the combination of a detaching and a newly starting backend
would use.

Regards

Markus Wanner


pgsql-hackers by date:

Previous
From: Markus Wanner
Date:
Subject: Re: multi-platform, multi-locale regression tests
Next
From: Andres Freund
Date:
Subject: Re: changing MyDatabaseId