After I upgraded to Mavericks, PostgreSQL started playing up, giving this error message whenever I call pg_restore
without calling the full path:
pg_restore: command not found
If I specify the full path it works, but that's obvious not optimal:
/Applications/Postgres93.app/Contents/MacOS/bin/pg_restore --verbose --clean --no-acl --no-owner -h localhost -U steven -d db/testivate_development $file_path
To fix this problem, I have tried removing all versions of PostgreSQL (with Homebrew) and then installed Postgres.app. You can confirm this has worked like this:
$ sudo find / -name pg_restore
/Applications/Postgres93.app/Contents/MacOS/bin/pg_restore
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
To add PostgreSQL to my path, I've tried adding each of the following lines to ~/.bash_profile
, ~/bashrc
and ~/.zshrc
, restarting after each attempt:
export PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"
...as per the postgresapp.com documentation, and then...
export PATH="/Applications/Postgres93.app/Contents/MacOS/bin:$PATH"
...as per the comments below.
None of this has solved my problem.
You can find postgresql. conf and look at param data_directory . If it is commented then database directory is the same as this config file directory. It will be depending on the distribution, they all do it slightly differently.
The quick way to verify the installation is through the psql program. First, click the psql application to launch it. The psql command-line program will display. Second, enter all the necessary information such as the server, database, port, username, and password.
Try adding this line to your .bash_profile:
export PATH="/Applications/Postgres93.app/Contents/MacOS/bin:$PATH"
and remove or comment out the previous reference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With