Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-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

pgsql-admin by date

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

pgsql-general by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group