Can I backup/restore a database in a sql script?

From: "Joost Kraaijeveld" <J(dot)Kraaijeveld(at)Askesis(dot)nl>
To: <pgsql-general(at)postgresql(dot)org>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: Can I backup/restore a database in a sql script?
Date: 2007-06-22 07:59:24
Message-ID: A3D1526C98B7C1409A687E0943EAC41060600F@obelix.askesis.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

Hi,

I want to write a sql script in which I backup a database and restore a new (altered) version of that database. Is that possible? If so , can anyone give me an example of how to do that?

I can run it from any command prompt (psql -U postgres template1 < my_db.backup) but I would like it to run from psql (which should give me 1 script for all platforms I must do this: Windows, FreeBSD and Debian)

TIA

Joost

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Achilleas Mantzios 2007-06-22 08:13:09 Re: Can I backup/restore a database in a sql script?
Previous Message Jayakumar_Mukundaraju 2007-06-22 07:22:14 Re: back up maintenance schedule

Browse pgsql-general by date

  From Date Subject
Next Message Achilleas Mantzios 2007-06-22 08:13:09 Re: Can I backup/restore a database in a sql script?
Previous Message Thomas Kellerer 2007-06-22 07:44:39 Re: standard LOB support