pg_restore with -C option does not create the database

Exactly like @Eelke said – you’ve got in file wrote ‘create database’ so this database does not exist when you’re running script… That’s what for there is always ‘postgres’ database. Try this: pg_restore -C -d postgres -v -h xxhostxx -p 5432 -U xxuserxx test_pg_dump.dmp** And this should: connect to postgres database Create test database Disconnect … Read more

pg_restore toc error

this did the trick pg_dump database_name -c -Ft -f file_name.tar pg_restore -d database_name -c file_name.tar before this i was trying to restore with out including -c(clean) even though -c is included in pg_dump it is not used in pg_restore unless we say to use…

How to fix pg_dump version mismatch errors?

OS X 10.8 comes with pg_dump version 9.1.4 in the /usr/bin directory, along with psql and other programs that are client-side PostgreSQL tools. It does not mean that PostgreSQL as a server is installed (unless you have OS X Server Edition). So you don’t have to uninstall PostgreSQL because it’s not installed and it’s better … Read more

pg_restore: [archiver] unsupported version (1.14) in file header

ubuntu guys: most likely your pg_restore is outdated. Just use postgres doc and install newest version of postgres: Create the file /etc/apt/sources.list.d/pgdg.list and add a line for the repository: deb http://apt.postgresql.org/pub/repos/apt/ YOUR_UBUNTU_VERSION_HERE-pgdg main where ubuntu versions are: 20.04 – focal 18.04 – bionic 16.04 – xenial Add keys: wget –quiet -O – https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo … Read more

tech