pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mladen Gogala <gogala.mladen@gmail.com>
To: Lucas <root@sud0.nz>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: ZFS filesystem - supported ?
Date: Sun, 24 Oct 2021 00:13:29 -0400
Message-ID: <77b0fb54-64f5-833d-19ba-2c731af1f700@gmail.com> (raw)
In-Reply-To: <741d4f14b64a45d7a9670042ac8ecf66@sud0.nz>
References: <49ijds_99IK_4iDOHuZH8CJsKGZw7DEVtJPf0s_oPEvUKwFewHcDQFCUnutcA9GYIkOrRfFAKRsyj0ZFN9ECAbLm-NYPR8jMxTl-RU-U3hA=@protonmail.ch>
	<1e0db1d2-6a9e-f5f7-44af-e7a1997bafcf@gmail.com>
	<I6YF48WTjPJw4DuktwELspDFbDUvnquzGNUUbuukjGiAYfNR3jj1sZAW4wQbs78mRxr84HBbnUjNtj36Vj98nBMk0jvGzqmu3Y5ZH9Egfuw=@protonmail.ch>
	<917520e4-0023-2842-db5f-2e1cbd72b004@gmail.com>
	<741d4f14b64a45d7a9670042ac8ecf66@sud0.nz>


On 10/23/21 23:12, Lucas wrote:
> I don't know where you have your database deployed, but in my case is 
> in AWS EC2 instances. The way I handle backups is at the block storage 
> level, performing EBS snapshots.

Yes, Amazon uses SAN equipment that supports snapshots.


> This has proven to work very well for me. I had to restore a few 
> backups already and it always worked. The bad part is that I need to 
> stop the database before performing the Snapshot, for data integrity, 
> so that means that I have a hot-standby server only for these snapshots.
> Lucas

Actually, you don't need to stop the database. You need to execute 
pg_start_backup() before taking a snapshot and then pg_stop_backup() 
when the snapshot is done. You will need to recover the database when 
you finish the restore but you will not lose any data. I know that 
pg_begin_backup() and pg_stop_backup() are deprecated but since 
PostgreSQL doesn't have any API for storage or file system snapshots, 
that's the only thing that can help you use storage snapshots as 
backups. To my knowledge,the only database that does have API for 
storage snapshots is DB2. The API is called "Advanced Copy Services" or 
ACS. It's documented here:

https://www.ibm.com/docs/en/db2/11.1?topic=recovery-db2-advanced-copy-services-acs

For Postgres, the old begin/stop backup functions should be sufficient.


-- 
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com

view thread (37+ messages)  latest in thread

Message-ID: <77b0fb54-64f5-833d-19ba-2c731af1f700@gmail.com>
Permalink:  ../77b0fb54-64f5-833d-19ba-2c731af1f700@gmail.com/
Also on:    postgresql.org/message-id/77b0fb54-64f5-833d-19ba-2c731af1f700@gmail.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: gogala.mladen@gmail.com, root@sud0.nz
  Subject: Re: ZFS filesystem - supported ?
  In-Reply-To: <77b0fb54-64f5-833d-19ba-2c731af1f700@gmail.com>
  References: <49ijds_99IK_4iDOHuZH8CJsKGZw7DEVtJPf0s_oPEvUKwFewHcDQFCUnutcA9GYIkOrRfFAKRsyj0ZFN9ECAbLm-NYPR8jMxTl-RU-U3hA=@protonmail.ch> <1e0db1d2-6a9e-f5f7-44af-e7a1997bafcf@gmail.com> <I6YF48WTjPJw4DuktwELspDFbDUvnquzGNUUbuukjGiAYfNR3jj1sZAW4wQbs78mRxr84HBbnUjNtj36Vj98nBMk0jvGzqmu3Y5ZH9Egfuw=@protonmail.ch> <917520e4-0023-2842-db5f-2e1cbd72b004@gmail.com> <741d4f14b64a45d7a9670042ac8ecf66@sud0.nz> <77b0fb54-64f5-833d-19ba-2c731af1f700@gmail.com>

* 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