Re: Replication questions - read-only and temporary read/write slaves

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tiffany Thang <tiffanythang(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Replication questions - read-only and temporary read/write slaves
Date: 2017-12-15 17:55:39
Message-ID: CABUevEwnjBCkcuSPJrt3YNyfZJo_2KKzC2+uUNKN0qGqSi_t4w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Dec 15, 2017 at 6:03 PM, Tiffany Thang <tiffanythang(at)gmail(dot)com>
wrote:

> Hi,
> In PostgreSQL, would it be possible to
>
> 1. set up a read-only slave database? The closest solution I could find is
> Hot Standby but the slave would not be accessible until after a failover.
>

Hot Standby will give you a standby database that is accessible, but in
read-only mode. This sounds like what you're looking for.

> 2. temporary convert a read-only slave in read-write mode for testing
> read/write workloads? Currently in Oracle, we can temporary open our
> read-only standby database in read-write mode to occasionally test our
> read-write workloads. We would stop the log apply on the standby database,
> convert the read-only database to read-write,
> perform our read/write test, discard all the changes after testing and
> reopen and resync the standby database in read-only mode. Is there a
> similar feature in PostgreSQL or are there ways to achieve something close
> to our needs?
>

No, you can't do this with postgres natively.

You could snapshot your filesystem before opening it and then roll back to
that snapshot, or something like that, but you cannot do it with just
PostgreSQL functionality.

--
Magnus Hagander
Me: https://www.hagander.net/ <http://www.hagander.net/>
Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tiffany Thang 2017-12-15 18:30:58 Re: Replication questions - read-only and temporary read/write slaves
Previous Message Tiffany Thang 2017-12-15 17:03:08 Replication questions - read-only and temporary read/write slaves