Database Administrators Asked by Irakli Ugulava on September 2, 2020
I have multiple dump files and want to restore them with single command. something like this
pg_restore -h localhost -p 5432 -U postgres
-d gl_election gl_world gl_tourism
-c "gl_election" "gl_world" "gl_tourism"
This command doesn’t work and I can’t find how to do it correctly. It works fine for one file.
pg_restore
doesn't take multiple filenames, nor multiple databases (-d) end of story. So use a simple shell loop. I assume you're trying to
That loop will look like this
for dump in gl_election gl_world gl_tourism; do
echo Clearing and reloading "$dump"
pg_restore -h localhost -p 5432 -U postgres -d "$dump" -c "$dump"
done;
Answered by Evan Carroll on September 2, 2020
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP