im trying to make a dump of all tables and schemes of an postgres docker container with the following command:
docker exec -i 3d7de2fb2d7a -u admin pg_dumpall > dumptest.sql
this creates a dumptest.sql
file which should contain everything.
The restore process looks like this:+
cat .\dumptest_neu.sql | docker exec -i bec713662fb6 psql -U admin
The Problem: After I have executed the command I get the following error message:
invalid command \":
ERROR: syntax error at or near "OCI"
LINE 1: OCI runtime exec failed: exec failed: container_linux.go:349...
^
After doing some research, I found out that I need to add a /bin/bash
to the command:
cat .\dumptest_neu.sql | docker exec -i 7f75d4c0c9e3 /bin/bash psql -U admin
And then I get the following message:
/usr/bin/psql: line 19: use: command not found
/usr/bin/psql: line 20: use: command not found
/usr/bin/psql: line 21: use: command not found
/usr/bin/psql: line 22: use: command not found
/usr/bin/psql: psql: line 24: syntax error near unexpected token `$version,'
/usr/bin/psql: psql: line 24: `my ($version, $cluster);'
Please help me im just trying to make a dump of everything in this postgres container.
This does not help beacause I have to dump all tables at once.