Re: .dmp files in postgresql - Mailing list pgsql-general

From Thom Brown
Subject Re: .dmp files in postgresql
Date
Msg-id CAA-aLv4ijiMNqbiuR+AkZcQRTH73acG7wGDp-rgazevGKfg8Yg@mail.gmail.com
Whole thread Raw
In response to .dmp files in postgresql  (Alpha Beta <dzjitaru@gmail.com>)
Responses Re: .dmp files in postgresql  (Alpha Beta <dzjitaru@gmail.com>)
List pgsql-general
On 25 November 2011 20:04, Alpha Beta <dzjitaru@gmail.com> wrote:
> Hi list,
> I have got two files (template1.dmp, example1.dmp) and I want to open them
> in postgresql, I tried the following commands:
> - Import template1 :
>     * createdb -U postgres template1
>     * psql -U postgres template1 < template1.dmp
> - Create the sample of the database:
>     * createdb -U postgres example1
>     * psql -U postgres example1 < example1.dmp
> I've got no error reported by postgres but nothing happened either.
> How should I proceed exactly? Sorry I'm a newbie with PostgreSQL :)

I'm assuming this is a custom-format file, which is a binary file.
You need to use pg_restore to restore the file:

For example:

pg_restore -d example1 example1.dmp

This is because the file is no in plain format.  Read the
documentation for more information on the output of pg_dump:
http://www.postgresql.org/docs/current/static/app-pgdump.html

Regards

Thom

pgsql-general by date:

Previous
From: Alpha Beta
Date:
Subject: .dmp files in postgresql
Next
From: Rich Shepard
Date:
Subject: Re: Recommended Protocol: Adding Rows to Table