Re: STOP all user access except for admin for a few minutes?

From: <org(at)kewlstuff(dot)co(dot)za>
To: "Tino Wildenhain" <tino(at)wildenhain(dot)de>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: STOP all user access except for admin for a few minutes?
Date: 2007-01-24 16:34:05
Message-ID: 000f01c73fd5$7a2dbbf0$0a00a8c0@animal
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers


Ha ha... thx Tino
Yes, I think this is way to go, strange how my mind climbs the wrong tree
sometimes :)
I actually need to aquire a transaction across several dB's, check if the
conditions are right, and then modify some tables, write and remove some
triggers.
Transactions in postgres are 2 sophisticated, I dont think they will hold
the locks at the level I need them.
But I was thinking (climbing out of the wrong tree;)... I can just aquire
exclusive locks on the tables, and hey presto, users are on hold while the
software checks the dB's.
Effectively creating a very rough transaction, with the lock scope needed?
... ie it will keep users out long enough to align several dB's... I'm
hoping?

From: "Tino Wildenhain" <tino(at)wildenhain(dot)de>
>> ================ maybe I'm in the wrong tree================
>
> Yes I'm thinking that too:
>
>> Is it possible to make quick structural changes to postgres, with user
>> activety?
>
> of course.
>
>> Maybe start a transaction that changes structure... wonder if that will
>> stop or hold user activity???
>
> Usually not - all your DDL is done in a transaction just like any other
> access users would make. So it only fails (but as a whole) if you want
> to modify locked tables and such. But you would not end up w/ a partly
> changed database in any case. Just make sure you do everything in
> a transaction. No need to suspend user accounts for that.
>
>
> Regards
> Tino
>
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message brian 2007-01-24 16:37:38 missing cache data for cache id 27
Previous Message Richard Huxton 2007-01-24 15:53:23 Re: how to read bytea field

Browse pgsql-hackers by date

  From Date Subject
Next Message Teodor Sigaev 2007-01-24 16:45:25 tsearch in core patch, for inclusion
Previous Message Stephen Frost 2007-01-24 16:32:53 Re: Default permissisons from schemas