pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Guillaume Lelarge <guillaume@lelarge.info>
To: Greg Sabino Mullane <greg@turnstep.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: How to start a database in ReadOnly mode?
Date: Sat, 09 Jul 2011 14:26:46 +0200
Message-ID: <1310214407.2101.36.camel@laptop> (raw)
In-Reply-To: <5fe0d78bda51d7176940fb8e78739b54@biglumber.com>
References: <5fe0d78bda51d7176940fb8e78739b54@biglumber.com>

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




view thread (5+ messages)

Message-ID: <1310214407.2101.36.camel@laptop>
Permalink:  ../1310214407.2101.36.camel@laptop/
Also on:    postgresql.org/message-id/1310214407.2101.36.camel@laptop

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: guillaume@lelarge.info, greg@turnstep.com
  Subject: Re: How to start a database in ReadOnly mode?
  In-Reply-To: <1310214407.2101.36.camel@laptop>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox