Thread: How to use pg_restore with *.sql file?
Hi,
I have generate an *.sql file with the command:
[quote]
pg_dump -a --inserts databasename > exportfilename.sql
[/quote]
How can I use the pg_restore to import the data to the database?
I have tried:
[quote]
pg_restore -d databasename exportfilename.sql
[/quote]
But without success...
What is the best way to import the *.sql file to the database?
Best Regards,
I have generate an *.sql file with the command:
[quote]
pg_dump -a --inserts databasename > exportfilename.sql
[/quote]
How can I use the pg_restore to import the data to the database?
I have tried:
[quote]
pg_restore -d databasename exportfilename.sql
[/quote]
But without success...
What is the best way to import the *.sql file to the database?
Best Regards,
On Sat, Sep 25, 2010 at 6:19 AM, Andre Lopes <lopes80andre@gmail.com> wrote: > Hi, > > I have generate an *.sql file with the command: > > [quote] > pg_dump -a --inserts databasename > exportfilename.sql > [/quote] > > How can I use the pg_restore to import the data to the database? Don't. Just use psql with plain sql dumps: psql databasename -f exportfilename.sql
Hey Andre,
You should not use pg_restore with plain format dump. Use psql for it.
// Dmitriy.
You should not use pg_restore with plain format dump. Use psql for it.
// Dmitriy.
Thanks a lot! It works.
On Sat, Sep 25, 2010 at 1:23 PM, Scott Marlowe <scott.marlowe@gmail.com> wrote:
On Sat, Sep 25, 2010 at 6:19 AM, Andre Lopes <lopes80andre@gmail.com> wrote:Don't.
> Hi,
>
> I have generate an *.sql file with the command:
>
> [quote]
> pg_dump -a --inserts databasename > exportfilename.sql
> [/quote]
>
> How can I use the pg_restore to import the data to the database?
Just use psql with plain sql dumps:
psql databasename -f exportfilename.sql