Re: How to implement backup protocol

From: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to implement backup protocol
Date: 2006-11-28 16:13:35
Message-ID: 20061128161335.GE6437@merkur.hilbert.loc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Nov 28, 2006 at 06:01:43PM +0200, Andrus wrote:

> 5. Server has *only* 5432 port open.
>
> pg_read_file() can read only text files and is restricted only to
> superusers.
>
> How to add a function pg_read_backup() to Postgres which creates and
> returns backup file with download speed ?

You could use an *un*trusted procedural language to create a
function to binary-read the backup from disk and return it
as a bytea field. Not sure how efficient that is, though.

You could then simply do

select get_backup();

If you allow for parameters you could make it return certain
backups based on, perhaps, timestamp of creation.

select list_available_backups();

might complete the suite of tools.

One could then always use some hashing tools (mhash with PG
bindings comes to mind) to verify whether a backup has arrived safely:

on local machine: ripemd160(backupfile)

select yhash.ripemd160(get_backup()) = <local hash>;

Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-11-28 16:14:40 Re: How to increace nightly backup speed
Previous Message Richard Huxton 2006-11-28 16:12:29 Re: Datafiles binary portable?