pg-restore

Why is pg_restore returning successfully but not actually restoring my database?

て烟熏妆下的殇ゞ 提交于 2019-11-29 20:25:23
I have a Postgres 8.4 database on a linux server that I have dumped using the following command: pg_dump --format=c --exclude-table=log --file=/path/to/output my_db I then ftp the created file to my local Windows 7 machine and attempt to restore the file to my local Postgres 8.4 instance using the following command: pg_restore --create --exit-on-error --verbose c:\path\to\file The restore command generates plenty of output claiming it created my database, connected to it, and then created all the other tables as expected. However, when I view the databases on my local machine through pgAdmin

Which pgdump format is best for small storage size and fast restore?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-29 14:26:16
This a first time foray in PostgreSQL backups (db dumps) and I've been researching the different pgdump formats, other pgdump options, and pgdumpall. For a Postgres beginner looking at taking an hourly dump (will overwrite previous dump) of two databases that contain table triggers and two different schemas in each db, what would be the backup format and options to easily achieve the following: Small file size (single file per db or ability to choose which db to restore) Easy to restore as clean db (with & without same db name[s]) Easy to restore on different server (user maybe different)

Restore dump on the remote machine

杀马特。学长 韩版系。学妹 提交于 2019-11-29 01:33:09
I've got my own machine with postgres dmp file, which I want to restore on the remote virtual machine (e.g. ip is 192.168.0.190 and postgres port is 5432) in my network. Is it possible to restore this dump using pg_restore without copying dump to remote machine? Because the size of dump about 12GB and the disk space on the virtual machine is 20GB. Thanks You can run a restore over the network without copying the dump to the remote host. Just invoke pg_restore with -h <hostname> and -p <port> (and probably -U <username> to authenticate as different user) on the host you got the dump file, for

I want to restore the database with a different schema

让人想犯罪 __ 提交于 2019-11-28 16:29:30
I have taken a dump of a database named temp1 , by using the follwing command $ pg_dump -i -h localhost -U postgres -F c -b -v -f pub.backup temp1 Now I want to restore the dump in a different database called "db_temp" , but in that I just want that all the tables should be created in a "temp_schema" ( not the default schema which is in the fms temp1 database ) which is in the "db_temp" database. Is there any way to do this using pg_restore command? Any other method also be appreciated! There's no way in pg_restore itself. What you can do is use pg_restore to generate SQL output, and then send

input file appears to be a text format dump. Please use psql

你。 提交于 2019-11-27 18:07:42
I take backup using pg_dump db_production > postgres_db.dump and then I copy it to localhost using scp. Now when I import on my local db it gives an error pg_restore: [archiver] input file appears to be a text format dump. Please use psql. by using commad line pg_restore -d db_development postgres_db.dump Before you downvote This is just a part of documentation! From the pg_dump documentation: Examples To dump a database called mydb into a SQL-script file : $ pg_dump mydb > db.sql To reload such a script into a (freshly created) database named newdb : $ psql -d newdb -f db.sql To dump a

Restore dump on the remote machine

ε祈祈猫儿з 提交于 2019-11-27 14:56:56
问题 I've got my own machine with postgres dmp file, which I want to restore on the remote virtual machine (e.g. ip is 192.168.0.190 and postgres port is 5432) in my network. Is it possible to restore this dump using pg_restore without copying dump to remote machine? Because the size of dump about 12GB and the disk space on the virtual machine is 20GB. Thanks 回答1: You can run a restore over the network without copying the dump to the remote host. Just invoke pg_restore with -h <hostname> and -p

I want to restore the database with a different schema

廉价感情. 提交于 2019-11-27 09:39:55
问题 I have taken a dump of a database named temp1 , by using the follwing command $ pg_dump -i -h localhost -U postgres -F c -b -v -f pub.backup temp1 Now I want to restore the dump in a different database called "db_temp" , but in that I just want that all the tables should be created in a "temp_schema" ( not the default schema which is in the fms temp1 database ) which is in the "db_temp" database. Is there any way to do this using pg_restore command? Any other method also be appreciated! 回答1:

input file appears to be a text format dump. Please use psql

血红的双手。 提交于 2019-11-26 19:10:40
问题 I take backup using pg_dump db_production > postgres_db.dump and then I copy it to localhost using scp. Now when I import on my local db it gives an error pg_restore: [archiver] input file appears to be a text format dump. Please use psql. by using commad line pg_restore -d db_development postgres_db.dump 回答1: Before you downvote This is just a part of documentation! From the pg_dump documentation: Examples To dump a database called mydb into a SQL-script file : $ pg_dump mydb > db.sql To