Re: read-only database

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Satoshi Nagayasu <nagayasus(at)nttdata(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: read-only database
Date: 2005-03-16 15:24:26
Message-ID: 6091.1110986666@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Satoshi Nagayasu <nagayasus(at)nttdata(dot)co(dot)jp> writes:
>> * Allow a warm standby system to also allow read-only queries

> Does anyone have any plan to work on this?

> I think we need to extend the pg_database catalog to
> have a database state (read-only or writable),
> and also need to extend ALTER DATABASE command
> to change the state.

Uh, no, because changing that would by definition not be a read-only
operation. Therefore there'd be no way to enter the read-only state,
and definitely no way to get out of it again. Furthermore, the
envisioned behavior is cluster-wide not per-database: the point is
to not execute transactions and not generate WAL entries, and you
don't get to be selective about that. (If it doesn't work like that,
you couldn't use it for the intended purpose of examining the state
of a hot-standby PITR backup that is actively tracking WAL logs
shipped from a master. It'd also not be useful for looking at
a corrupted cluster.)

I'd view this as a postmaster state that propagates to backends.
Probably you'd enable it by means of a postmaster option, and the
only way to get out of it is to shut down and restart the postmaster
without the option.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-03-16 15:39:15 Re: PQexecParams
Previous Message Tom Lane 2005-03-16 15:17:17 Re: Erratic error message "ERROR: column "id_compte" does

Browse pgsql-patches by date

  From Date Subject
Next Message Christof Petig 2005-03-16 15:30:00 Re: [INTERFACES] libecpg (8.0 and CVS) hits a gcc bug on powerpc
Previous Message Bruce Momjian 2005-03-16 15:07:28 Re: [pgsql-hackers-win32] snprintf causes regression tests