Re: How to start a database in ReadOnly mode?

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Greg Sabino Mullane <greg(at)turnstep(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: How to start a database in ReadOnly mode?
Date: 2011-07-09 12:26:46
Message-ID: 1310214407.2101.36.camel@laptop
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Sat, 2011-07-09 at 11:58 +0000, Greg Sabino Mullane wrote:
> > Is it possible to start a postgres cluster or 1 postgres database in
> > readonly mode? And - if yes - how can this be done?
>
> Clusterwide: edit postgresql.conf and set
> default_transaction_read_only = on;
>
> No restart needed, just a reload (HUP)
>
> Database-wide:
>
> ALTER DATABASE foobar SET default_transaction_read_only = true;
>

The only issue is that any user can unset this parameter with a SET
query on his session.

--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Uwe Bartels 2011-07-10 18:54:10 using explain output within pgsql
Previous Message Greg Sabino Mullane 2011-07-09 11:58:52 Re: How to start a database in ReadOnly mode?