Re: Lock out PostgreSQL users for maintenance

From: Boszormenyi Zoltan <zb(at)cybertec(dot)at>
To: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Lock out PostgreSQL users for maintenance
Date: 2012-05-12 11:57:20
Message-ID: 4FAE5020.2040508@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2012-05-12 06:29 keltezéssel, Alexander Farber írta:
> Or should I edit pg_hba.conf and restart the process?

host all postgres 127.0.0.1/32 md5
host all all 0.0.0.0/0 reject

Only postgres user is allowed to connect. You don't need
to restart the server, one of these would do:

killall -HUP postmaster
or
SELECT pg_reload_conf();

To kick out the current users except yourself, do:

SELECT pg_terminate_backend(procpid)
FROM pg_stat_activity WHERE procpid <> pg_backend_pid();

>
> Thank you
> Alex
>

--
----------------------------------
Zoltán Böszörményi
Cybertec Schönig& Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt, Austria
Web: http://www.postgresql-support.de
http://www.postgresql.at/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2012-05-12 14:11:08 Re: Variables inside plpythonu
Previous Message Frank Lanitz 2012-05-12 06:50:55 Re: Lock out PostgreSQL users for maintenance