Re: .dmp files in postgresql

From: Alpha Beta <dzjitaru(at)gmail(dot)com>
To: Thom Brown <thom(at)linux(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: .dmp files in postgresql
Date: 2011-11-25 20:31:57
Message-ID: CAMheTCQR7sye+nS4Y-CUVFPB7BQk-6n0Eunftk+Lhqq9w7x05A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

While you say, I opened the file with bloc note and I noticed that it's not
a binary file but plain with SQL commands and so on.
I tried what you said also but didn't work.
Any suggestion? or maybe the commands I'm using doesn't find the path for
the 2 files?

2011/11/25 Thom Brown <thom(at)linux(dot)com>

> On 25 November 2011 20:04, Alpha Beta <dzjitaru(at)gmail(dot)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
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thom Brown 2011-11-25 20:39:20 Re: .dmp files in postgresql
Previous Message Rich Shepard 2011-11-25 20:09:30 Re: Recommended Protocol: Adding Rows to Table