Re: Is there a way to backup Postgres via SQL commands? - Mailing list pgsql-general

From Merlin Moncure
Subject Re: Is there a way to backup Postgres via SQL commands?
Date
Msg-id AANLkTimaEGTfodKvEjh-mv6RTcFpIGm8gpG4myFsxtPK@mail.gmail.com
Whole thread Raw
In response to Is there a way to backup Postgres via SQL commands?  (Frank Church <voipfc@googlemail.com>)
List pgsql-general
On Mon, Jun 14, 2010 at 7:28 AM, Frank Church <voipfc@googlemail.com> wrote:
> Are there SQL commands that can do a backup over a client connection,
> rather than from the command line like pgsql etc?
>
> By that I mean some kind of SELECT commands that can retrieve the
> database's content as SQL commands that can be replayed to a server to
> restore it, rather than something that saves directly to file, or
> passes it through a pipe?

no -- it's actually possible for some trivial things (just grabbing a
few tables) -- but anything more complicated will quickly become
unreasonably difficult.

TBH, I think backups through SQL are quite nice.  Judging by the
standard of other databases, I generally always prefer the sql version
to the command line variant with both tools are available.

It would also be nice to be able to generate a restorable script from
any userland object.  pg_dump/pg_restore gives you the ability to
specifically grab indexes, functions, table, and triggers, but that's
it.

merlin

pgsql-general by date:

Previous
From: Craig Ringer
Date:
Subject: Re: What are the minimal files required to backup a postgresql database
Next
From: Gaurav K Srivastav
Date:
Subject: Trigger get dissabled