Re: Streaming base backups
Magnus Hagander <magnus@hagander.net>
From: Magnus Hagander <magnus@hagander.net>
To: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2011-01-08T16:34:01Z
Lists: pgsql-hackers
Attachments
- basebackup.patch (text/x-patch) patch
On Thu, Jan 6, 2011 at 23:57, Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> wrote: > > Looks like pg_streamrecv creates the pg_xlog and pg_tblspc directories, > because they're not included in the streamed tar. Wouldn't it be better to > include them in the tar as empty directories at the server-side? Otherwise > if you write the tar file to disk and untar it later, you have to manually > create them. Attached is an updated patch that does this. It also collects all the header records as a single resultset at the beginning. This made for cleaner code, but more importantly makes it possible to get the total size of the backup even if there are multiple tablespaces. It also changes the tar members to use relative paths instead of absolute ones - since we send the root of the directory in the header anyway. That also takes away the "./" portion in all tar members. git branch on github updated as well, of course. -- Magnus Hagander Me: http://www.hagander.net/ Work: http://www.redpill-linpro.com/