Re: How to start a database in ReadOnly mode?

From: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Cc: pgsql-admin(at)postgresql(dot)org Content-Type: multipart/alternative; boundary=001485e76f4600a3c704a7756ca4 X-Virus-Scanned: Maia Mailguard 1(dot)0(dot)1 X-Mailing-List: pgsql-admin List-Archive: <http://archives(dot)postgresql(dot)org/pgsql-admin> List-Help: <mailto:majordomo(at)postgresql(dot)org?body=help> List-ID: <pgsql-admin(dot)postgresql(dot)org> List-Owner: <mailto:pgsql-admin-owner(at)postgresql(dot)org> List-Post: <mailto:pgsql-admin(at)postgresql(dot)org> List-Subscribe: <mailto:majordomo(at)postgresql(dot)org?body=sub%20pgsql-admin> List-Unsubscribe: Paul Schluck <pschluck(at)gmail(dot)com>
Subject: Re: How to start a database in ReadOnly mode?
Date: 2011-07-09 11:58:52
Message-ID: 5fe0d78bda51d7176940fb8e78739b54@biglumber.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

> 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;

- --
Greg Sabino Mullane greg(at)turnstep(dot)com
End Point Corporation http://www.endpoint.com/
PGP Key: 0x14964AC8 201107090757
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAk4YQkIACgkQvJuQZxSWSsidzgCg1dpGvT6IY35NmMl1psiBlKuj
B2sAoJhdD3vlg0F/GwjhO1SCMfK/hhWS
=dRd9
-----END PGP SIGNATURE-----

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Guillaume Lelarge 2011-07-09 12:26:46 Re: How to start a database in ReadOnly mode?
Previous Message Kevin Grittner 2011-07-08 13:54:47 Re: row is too big during cluster