If you have a PostgreSQL dump in the custom format you can can view the text format dump (plain SQL statements). PostgreSQL 12 and newer Write it as a textdump...

pg_restore $dumpname -f name.textdump Applying parameters You can apply the same parameters for the output of the textdump as for restoring the dump (for e.g. --clean...

This card is just about creating simple PostgreSQL dumps. This is no instruction for a backup strategy nor a guide for SQL dump performance optimization. Read before starting

...mind that you should stop the replication on a slave PostgreSQL server before creating dumps Dumps can get huge, be careful so that the system running a production PostgreSQL won...

github.com

File import/export Caution Target data will also be overwriten! # Create dump ./riot file-export -h 127.0.0.1 -p 6379 dump.json Exporting 100% [====================================================] 2630/2630...

# Restore dump ./riot file-import -u "$REDIS_URL_TARGET" dump.json Importing dump.json ? % [ = ] 2630/? (0:00:02 / ?) 1315.0/s

postgresql.org

There is an issue with when restoring a PostgreSQL dump created with pg_dump < v11 with pg_restore > v10: pg_restore: [archiver (db)] could not execute query: ERROR: schema "public...

Command was: CREATE SCHEMA public; Convert If you want to restore this dump you should convert the dump to the text format first and comment out the CREATE...

...This is an edge-case. You probably don't want to mix different database dumps. It also requires that the mixed tables do not share relations to other database objects...

You've got two database dumps: dump_a.pgdump dump_b.pgdump Both dumps include these tables: foobar barfoo foobaz You want to create a dump with: dump_a.foobar dump_b.barfoo dump_a.foobaz Invalid and incomplete...

...results to be avoid unexpected consequences. Can I Test Things Locally With a Database Dump? Unfortunately not. Restoring from a logical database backup, i.e. an SQL dump, will not reproduce...

...the error and is not suitable for testing changes, since importing dumps will re-create indexes in the first place. How Do I Test All Indexes In All Databases?

The first number fs_freq When this field is set to 1 dump(8) will make a backup of the partition. Not using dump for backups? You can...

Best results in other decks

...latter is invoked, which performs the actual migrations. Knowing this, it is easy to dump the db only if migrations will run. First, enable conditional migrations: # config/deploy.rb set :conditionally_migrate...

...migrating runs them before 'deploy:migrating', 'db:dump' Background In case you haven't employed dump-creation on deploy before, you can do it like this: Install geordi on your...

When dumping your Heroku Postgre database (with heroku pg:backups:capture --app my-app and heroku pg:backups:download --app my-app), it will result in a binary dump.

...also a flag to omit the schema and output only the data of the dump: --data-only. This may be useful if you can restore the schema otherwise, e.g. when...

Search in all decks