From: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> |
---|---|
To: | klo uo <klonuo(at)gmail(dot)com>, PostgreSQL General <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: How to restore backup database |
Date: | 2014-09-08 18:10:09 |
Message-ID: | 540DF101.90107@aklaver.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 09/08/2014 10:49 AM, klo uo wrote:
> Hi Adrian,
>
> I used pgAdmin backup command.
> However in the meantime I figured how to restore.
> I first have to create database, and then use restore option which
> becomes available if I right-click on a database.
> On MSSQL for example, I can restore database without creating database
> first, and I guess I was expecting similar behavior.
You do not have to create a database in Postgres either. There are some
system databases already created for you, template0(read only best left
alone), template1 and postgres. You can connect to one of these(best
practices, use postgres) and then have the restore script create the new
database.<IMPORTANT> If you do this you need to check the Include CREATE
DATABASE statement box (http://www.pgadmin.org/docs/1.18/restore.html)
<IMPORTANT>
To get a better idea of what is going on I would suggest reading the
following sections of the docs:
http://www.postgresql.org/docs/9.3/interactive/app-pgdump.html
http://www.postgresql.org/docs/9.3/interactive/app-pgrestore.html
This is what pgAdmin is using behind the scenes.
>
>
> Cheers
>
>
--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Abelard Hoffman | 2014-09-08 18:39:43 | Re: psql and tab-delimited output |
Previous Message | Dmitriy Igrishin | 2014-09-08 17:59:00 | Async IO HTTP server frontend for PostgreSQL |