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

From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: org(at)kewlstuff(dot)co(dot)za
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: STOP all user access except for admin for a few minutes?
Date: 2007-01-23 15:37:05
Message-ID: 45B62BA1.1050001@wildenhain.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

org(at)kewlstuff(dot)co(dot)za schrieb:
> Thx Russel,
> I want to control it from software, changing network access via pg_hba
> with software doesnt feel right.
>
> ================ possible case================
> Say I have a Group called Normal_Rights and one called Zero_Rights.
>
> So dB runs as... Normal_Rights(User A, User B, User C, User D)
> Then via sql, superuser REVOKEs those user rights and GRANTs them
> Zero_Rights(User A, User B, User C, User D)... ie make users a member of
> the ZERO rights group.
>
> Then hopefully Postgres kicks them out gracefully?????
>
> Then software make changes and switch's them back to their Normal_Rights
> group.
>
> ================ or more general case================
> RECORD all the SQL for all user rights...
> REVOKE everything except needed software superusers (postgres, and
> program superuser).
> make changes via software.
> PLAY BACK all the rights SQL script.
>
> What do you think, will PG kill connections, let them go gracefully,
> stop after current transaction????
>
> ================ 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 Tino Wildenhain 2007-01-23 15:38:21 Re: Postgresql.conf
Previous Message Harald Armin Massa 2007-01-23 15:37:01 Re: Installing PostgreSQL under Cpanel

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-01-23 15:39:25 Re: Updateable cursors
Previous Message Bruce Momjian 2007-01-23 15:34:57 Re: [HACKERS] Win32 WEXITSTATUS too