pdql, pg_dump, and pg_restore

From: nzanella(at)cs(dot)mun(dot)ca (Neil Zanella)
To: pgsql-general(at)postgresql(dot)org
Subject: pdql, pg_dump, and pg_restore
Date: 2004-07-31 19:57:27
Message-ID: b68d2f19.0407311157.6898902e@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I have an SQL database which I create with:

psql -f create.sql foodb

I then access this database and perform several insertions, modifications,
and deletions. Finally, I want to backup my database. I do not want to
backup the schema. All I want is a set of insert statements stored in
a file insert.sql which I can run on a set of empty database tables
with the command:

psql -f insert.sql foodb

in order to restore the contents of the database to what it was previously.

I have tried the utilities pg_dump and pg_restore and
read the manual pages, but after running pg_dump I get a file with the whole
schema, not exactly what I wanted. And when I restore it my application
does not find what it needs any more.

So my question is, how do I properly do the type of dump and restore that
I have described above. I don't care which file format, as long as I can
just repopulate empty tables. I am not sure what I am doing wrong, but
the problem I am having is that upon restoring the dump my application
does not find the appropriate fields in the appropriate tables. ???

All that should be needed is one command to dump, and one to restore, right?

Thanks,

Neil

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joel Rodrigues 2004-08-01 08:42:16 Fwd: [NOVICE] contrib/xml make error on Mac OS X 10.3.4
Previous Message Olivier Guilyardi 2004-07-31 19:44:18 Re: Correct escaping of untrusted data