![]() In case it helps readers or anyone looking to create their own pg_dump output in the future, I created the backup with the command pg_dump -h localhost -U postgres -W apGymPostgres > apgym. Please don't suggest alternatives: I want to do it this way. How can I restore my backed up postgres db? I need to be able to do this in case my data is ruined and I want to go back. Values of the numeric, int, and bigint data types can be cast to money. I can't use pgAdmin to restore from the backup either, it says the status is "Failed" in 0.02 seconds. To avoid problems, before restoring a dump into a new database make sure lcmonetary has the same or equivalent value as in the database that was dumped. Psql: error: apgym.sql: No such file or directory I enter psql -d testRestore -f apgym.sql in the same directory as my apgym.sql file and I get: could not change directory to "/home/rlm": Permission denied Sudo su postgres and become the postgres user. I type it and I get psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "rlm" does not exist I don't understand the error message, but I'll try again as the Postgres user. So I type pg_restore -d testRestore -U postgres apgym.sql and I get: pg_restore: error: input file appears to be a text format dump. I am on Ubuntu 22.04.Īs my usual user, rlm, at ~ I can type dir and get, among other files, my apgym.sql output from pg_dump. I am trying to use psql or pg_restore to restore my copy of a Postgres database to a new database.
0 Comments
Leave a Reply. |