By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,807 Members | 1,995 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,807 IT Pros & Developers. It's quick & easy.

pg_restore does not restore

P: n/a
Hi:

I'm trying to dump tableA and restore it to tableB:

$ ./pg_dump -Fc -t tableA databaseA -f tableA.dump -v
$ ./pg_restore -t tableB -d databaseA tableA.dump -v

pg_dump creates tableA.dump aparently well, but after running pg_restore
without errors I cannot find any "tableB", what am I doing wrong?

I upgraded postgres version recently, the postmaster is running on port
5433, and pg_dump and pg_restore are now under /usr/local/pgsql/bin.

These are the outputs of the commands with -v (verbose):

$ ./pg_dump -Fc -t tableA databaseA -f tableA.dump -v
pg_dump: saving encoding
pg_dump: saving database definition
pg_dump: reading schemas
pg_dump: reading user-defined types
pg_dump: reading user-defined functions
pg_dump: reading user-defined aggregate functions
pg_dump: reading user-defined operators
pg_dump: reading user-defined operator classes
pg_dump: reading user-defined tables
pg_dump: reading table inheritance information
pg_dump: finding inheritance relationships
pg_dump: reading column info for interesting tables
pg_dump: finding the columns and types of table "tableA"
pg_dump: finding default expressions of table "tableA"
pg_dump: flagging inherited columns in subtables
pg_dump: dumping out database comment
pg_dump: dumping out user-defined schemas
pg_dump: dumping out user-defined types
pg_dump: dumping out tables
pg_dump: dumping out indexes
pg_dump: dumping out user-defined procedural languages
pg_dump: dumping out user-defined functions
pg_dump: dumping out user-defined aggregate functions
pg_dump: dumping out user-defined operators
pg_dump: dumping out user-defined operator classes
pg_dump: dumping out user-defined casts
pg_dump: preparing to dump the contents of table tableA
pg_dump: dumping out rules
pg_dump: dumping contents of table tableA

$ ./pg_restore -t tableA_borrar -d databaseA tableA.dump -v
pg_restore: connecting to database for restore
pg_restore: implied data-only restore
Thanks.

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
ruben <ru*****@superguai.com> writes:
I'm trying to dump tableA and restore it to tableB:


pg_dump does not do that. The -t switch is for selecting one table
among several, not for renaming anything.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.