I am running Postgres on a Docker container.
I have been trying to following the example show to deploy scripts using Sqitch from the
following page:
https://metacpan.org/pod/sqitchtutorial
Now I have got as far as creating my folders for Deploy, Revert and Verify
I then try to deploy changes using the following command:
sqitch deploy db:pg://username:password@localhost/flipr_test
where i pass in my username and password
However i get the following error message:
Adding registry tables to db:pg://postgres:@localhost/flipr_test
"/opt/local/pgsql/bin/psql" failed to start: "The system cannot find the path specified"
How can I get Sqitch to run to deploy a database to Postgres running on a Docker Container?
2
Answers
Need to do the following :
This sqitch file runs Sqitch in a Docker Container
Comment out the following line:
This means that psql will then be used from the Postgres container
Here the sqitch.bat is running up Sqitch in the Docker Container and then from there can run the deploy command to deploy changes
Not really an answer, just a long comment describing how to troubleshoot/fix this. Sqitch uses database native clients to connect to the respective engine. In the Postgres case that is
psql
. You need to havepsql
installed and accessible when you run Sqitch commands against the engine. As a for instance, in Ubuntu/Debian that would be installing thepostgresql-client
package. You have not mentioned what OS you are using so the install maybe different. Thepsql
client would also need to be ‘seen’ by thesqitch deploy
command wherever you are running that. You don’t indicate wheresqitch deploy
is being run, on the Docker host or in the Docker container. In either casepsql
needs to be present at the path specified for the command run. In your case eitherpsql
is not installed or if installed it is at path other then/opt/local/pgsql/bin/psql
. In the tutorial search forsqitch config --user engine.pg.client
to see how you can change the path.