How to put psql on the path when using Postgres.app on OS X?
I've installed Postgres93 on my Mac. I can open the application, and "Open psql" through the app which opens up a command line interface with psql.
However, when I type $ which psql
nothing is returned. The installation path is /Applications/Postgres93.app
. How do I make $ which psql
show the correct result?
Mac OS X - Mavericks
PostgreSQL package, I'm not as sure about. I went here and downloaded it - http://postgresapp.com/
macos postgresql psql
add a comment |
I've installed Postgres93 on my Mac. I can open the application, and "Open psql" through the app which opens up a command line interface with psql.
However, when I type $ which psql
nothing is returned. The installation path is /Applications/Postgres93.app
. How do I make $ which psql
show the correct result?
Mac OS X - Mavericks
PostgreSQL package, I'm not as sure about. I went here and downloaded it - http://postgresapp.com/
macos postgresql psql
Please always specify (a) your Mac OS X version, since Apple love changing stuff in random and exciting ways, and (b) What PostgreSQL packaging you are using - homebrew, heroku postgres.app, enterprisedb one-click, macports, etc. Easy to guess in this case, but only because you specified the path.
– Craig Ringer
Jan 5 '14 at 1:12
add a comment |
I've installed Postgres93 on my Mac. I can open the application, and "Open psql" through the app which opens up a command line interface with psql.
However, when I type $ which psql
nothing is returned. The installation path is /Applications/Postgres93.app
. How do I make $ which psql
show the correct result?
Mac OS X - Mavericks
PostgreSQL package, I'm not as sure about. I went here and downloaded it - http://postgresapp.com/
macos postgresql psql
I've installed Postgres93 on my Mac. I can open the application, and "Open psql" through the app which opens up a command line interface with psql.
However, when I type $ which psql
nothing is returned. The installation path is /Applications/Postgres93.app
. How do I make $ which psql
show the correct result?
Mac OS X - Mavericks
PostgreSQL package, I'm not as sure about. I went here and downloaded it - http://postgresapp.com/
macos postgresql psql
macos postgresql psql
edited Jan 5 '14 at 1:26
Craig Ringer
198k35406532
198k35406532
asked Jan 5 '14 at 0:57
Don PDon P
18.9k71203329
18.9k71203329
Please always specify (a) your Mac OS X version, since Apple love changing stuff in random and exciting ways, and (b) What PostgreSQL packaging you are using - homebrew, heroku postgres.app, enterprisedb one-click, macports, etc. Easy to guess in this case, but only because you specified the path.
– Craig Ringer
Jan 5 '14 at 1:12
add a comment |
Please always specify (a) your Mac OS X version, since Apple love changing stuff in random and exciting ways, and (b) What PostgreSQL packaging you are using - homebrew, heroku postgres.app, enterprisedb one-click, macports, etc. Easy to guess in this case, but only because you specified the path.
– Craig Ringer
Jan 5 '14 at 1:12
Please always specify (a) your Mac OS X version, since Apple love changing stuff in random and exciting ways, and (b) What PostgreSQL packaging you are using - homebrew, heroku postgres.app, enterprisedb one-click, macports, etc. Easy to guess in this case, but only because you specified the path.
– Craig Ringer
Jan 5 '14 at 1:12
Please always specify (a) your Mac OS X version, since Apple love changing stuff in random and exciting ways, and (b) What PostgreSQL packaging you are using - homebrew, heroku postgres.app, enterprisedb one-click, macports, etc. Easy to guess in this case, but only because you specified the path.
– Craig Ringer
Jan 5 '14 at 1:12
add a comment |
7 Answers
7
active
oldest
votes
It appears that you installed Heroku's Postgres.app
, which is a tool intended for throw-away testing and development. Add the contents of the bundle to your PATH
by following the instructions in the Postgres.app documentation - see "command line tools".
add a comment |
I just had postgres installed and was not able to run the psql command until I ran the following command in my terminal:
export PATH="/Applications/Postgres.app/Contents/Versions/9.5/bin:$PATH"
Now the terminal knows where to find postgres when I use the psql command.
Remember to replace the version number '9.5' with your current version.
11
It's recommended to change that 9.5 tolatest
. There's a nice symlink in the Versions folder.
– Ali
May 8 '17 at 15:25
1
This worked for me! Thanks!
– richddr
Feb 27 at 23:43
add a comment |
** Edited: to include a permanent fix, not just during your current session. **
I had this same problem, and also found a clear answer lacking in the docs.
To fix:
Download the new app, and follow the instructions to move it to the Applications folder
Add the new bundle to your path by typing the following in your Terminal (version number specific - mine is 9.4):
PATH="/Applications/Postgres.app/Contents/Versions/9.4/bin:$PATH"
To fix the issue on a permanent basis, run the same line but with export in front:
export PATH="/Applications/Postgres.app/Contents/Versions/9.4/bin:$PATH"
3
Does this change$PATH
permanently? For me it only lasted until I closed the Terminal window. Editing the ~/.bash_profile file was the permanent solution in my case.
– jkdev
Jan 28 '15 at 8:41
add a comment |
I had the same problem with nothing showing for the which psql command till I run the command below to resolve it. The command provided below is just a little tweak of what has already been provided by others here. The only difference is, instead of providing a specific postgres version number in the command, you can simply tell postgres to use the latest postgres version by simply running the following command:
export
PATH="/Applications/Postgres.app/Contents/Versions/latest/bin:$PATH"
And now my terminal was able to find the path to postgres when I run which psql.
Hope this helps.
add a comment |
I just experienced the same problem, and solved it by adding export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin
to .bash_profile. Note that this line is version-specific, so be sure to check this line against your current version of Postgres.app.
add a comment |
On macOS Mojave these instructions work well:
If your Postgres has not been installed yet, I suggest you use the great "brew" package manager from here https://brew.sh/ :
$ brew cask install postgres
or you can install it usual way from the websitePut this to the bottom of your ~/.bash_profile file:
export PATH="/Applications/Postgres.app/Contents/Versions/latest/bin:$PATH"
Restart your terminal or restart your ~/.bash_profile directly with the command:
$ . ~/.bash_profile
Verify your installation:
$ psql --version
add a comment |
On macos mojave i've added the following line on my ~/.profile :
export PATH=$PATH:/Library/PostgreSQL/10/bin
the psql command line client lies into this folder. i've used the enterprisedb installer.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f20928734%2fhow-to-put-psql-on-the-path-when-using-postgres-app-on-os-x%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
7 Answers
7
active
oldest
votes
7 Answers
7
active
oldest
votes
active
oldest
votes
active
oldest
votes
It appears that you installed Heroku's Postgres.app
, which is a tool intended for throw-away testing and development. Add the contents of the bundle to your PATH
by following the instructions in the Postgres.app documentation - see "command line tools".
add a comment |
It appears that you installed Heroku's Postgres.app
, which is a tool intended for throw-away testing and development. Add the contents of the bundle to your PATH
by following the instructions in the Postgres.app documentation - see "command line tools".
add a comment |
It appears that you installed Heroku's Postgres.app
, which is a tool intended for throw-away testing and development. Add the contents of the bundle to your PATH
by following the instructions in the Postgres.app documentation - see "command line tools".
It appears that you installed Heroku's Postgres.app
, which is a tool intended for throw-away testing and development. Add the contents of the bundle to your PATH
by following the instructions in the Postgres.app documentation - see "command line tools".
answered Jan 5 '14 at 1:09
Craig RingerCraig Ringer
198k35406532
198k35406532
add a comment |
add a comment |
I just had postgres installed and was not able to run the psql command until I ran the following command in my terminal:
export PATH="/Applications/Postgres.app/Contents/Versions/9.5/bin:$PATH"
Now the terminal knows where to find postgres when I use the psql command.
Remember to replace the version number '9.5' with your current version.
11
It's recommended to change that 9.5 tolatest
. There's a nice symlink in the Versions folder.
– Ali
May 8 '17 at 15:25
1
This worked for me! Thanks!
– richddr
Feb 27 at 23:43
add a comment |
I just had postgres installed and was not able to run the psql command until I ran the following command in my terminal:
export PATH="/Applications/Postgres.app/Contents/Versions/9.5/bin:$PATH"
Now the terminal knows where to find postgres when I use the psql command.
Remember to replace the version number '9.5' with your current version.
11
It's recommended to change that 9.5 tolatest
. There's a nice symlink in the Versions folder.
– Ali
May 8 '17 at 15:25
1
This worked for me! Thanks!
– richddr
Feb 27 at 23:43
add a comment |
I just had postgres installed and was not able to run the psql command until I ran the following command in my terminal:
export PATH="/Applications/Postgres.app/Contents/Versions/9.5/bin:$PATH"
Now the terminal knows where to find postgres when I use the psql command.
Remember to replace the version number '9.5' with your current version.
I just had postgres installed and was not able to run the psql command until I ran the following command in my terminal:
export PATH="/Applications/Postgres.app/Contents/Versions/9.5/bin:$PATH"
Now the terminal knows where to find postgres when I use the psql command.
Remember to replace the version number '9.5' with your current version.
edited Nov 9 '16 at 20:15
edu222
331520
331520
answered Feb 18 '16 at 23:21
BertBert
457159
457159
11
It's recommended to change that 9.5 tolatest
. There's a nice symlink in the Versions folder.
– Ali
May 8 '17 at 15:25
1
This worked for me! Thanks!
– richddr
Feb 27 at 23:43
add a comment |
11
It's recommended to change that 9.5 tolatest
. There's a nice symlink in the Versions folder.
– Ali
May 8 '17 at 15:25
1
This worked for me! Thanks!
– richddr
Feb 27 at 23:43
11
11
It's recommended to change that 9.5 to
latest
. There's a nice symlink in the Versions folder.– Ali
May 8 '17 at 15:25
It's recommended to change that 9.5 to
latest
. There's a nice symlink in the Versions folder.– Ali
May 8 '17 at 15:25
1
1
This worked for me! Thanks!
– richddr
Feb 27 at 23:43
This worked for me! Thanks!
– richddr
Feb 27 at 23:43
add a comment |
** Edited: to include a permanent fix, not just during your current session. **
I had this same problem, and also found a clear answer lacking in the docs.
To fix:
Download the new app, and follow the instructions to move it to the Applications folder
Add the new bundle to your path by typing the following in your Terminal (version number specific - mine is 9.4):
PATH="/Applications/Postgres.app/Contents/Versions/9.4/bin:$PATH"
To fix the issue on a permanent basis, run the same line but with export in front:
export PATH="/Applications/Postgres.app/Contents/Versions/9.4/bin:$PATH"
3
Does this change$PATH
permanently? For me it only lasted until I closed the Terminal window. Editing the ~/.bash_profile file was the permanent solution in my case.
– jkdev
Jan 28 '15 at 8:41
add a comment |
** Edited: to include a permanent fix, not just during your current session. **
I had this same problem, and also found a clear answer lacking in the docs.
To fix:
Download the new app, and follow the instructions to move it to the Applications folder
Add the new bundle to your path by typing the following in your Terminal (version number specific - mine is 9.4):
PATH="/Applications/Postgres.app/Contents/Versions/9.4/bin:$PATH"
To fix the issue on a permanent basis, run the same line but with export in front:
export PATH="/Applications/Postgres.app/Contents/Versions/9.4/bin:$PATH"
3
Does this change$PATH
permanently? For me it only lasted until I closed the Terminal window. Editing the ~/.bash_profile file was the permanent solution in my case.
– jkdev
Jan 28 '15 at 8:41
add a comment |
** Edited: to include a permanent fix, not just during your current session. **
I had this same problem, and also found a clear answer lacking in the docs.
To fix:
Download the new app, and follow the instructions to move it to the Applications folder
Add the new bundle to your path by typing the following in your Terminal (version number specific - mine is 9.4):
PATH="/Applications/Postgres.app/Contents/Versions/9.4/bin:$PATH"
To fix the issue on a permanent basis, run the same line but with export in front:
export PATH="/Applications/Postgres.app/Contents/Versions/9.4/bin:$PATH"
** Edited: to include a permanent fix, not just during your current session. **
I had this same problem, and also found a clear answer lacking in the docs.
To fix:
Download the new app, and follow the instructions to move it to the Applications folder
Add the new bundle to your path by typing the following in your Terminal (version number specific - mine is 9.4):
PATH="/Applications/Postgres.app/Contents/Versions/9.4/bin:$PATH"
To fix the issue on a permanent basis, run the same line but with export in front:
export PATH="/Applications/Postgres.app/Contents/Versions/9.4/bin:$PATH"
edited Nov 11 '15 at 19:22
answered Apr 10 '14 at 20:30
jennystanchakjennystanchak
14125
14125
3
Does this change$PATH
permanently? For me it only lasted until I closed the Terminal window. Editing the ~/.bash_profile file was the permanent solution in my case.
– jkdev
Jan 28 '15 at 8:41
add a comment |
3
Does this change$PATH
permanently? For me it only lasted until I closed the Terminal window. Editing the ~/.bash_profile file was the permanent solution in my case.
– jkdev
Jan 28 '15 at 8:41
3
3
Does this change
$PATH
permanently? For me it only lasted until I closed the Terminal window. Editing the ~/.bash_profile file was the permanent solution in my case.– jkdev
Jan 28 '15 at 8:41
Does this change
$PATH
permanently? For me it only lasted until I closed the Terminal window. Editing the ~/.bash_profile file was the permanent solution in my case.– jkdev
Jan 28 '15 at 8:41
add a comment |
I had the same problem with nothing showing for the which psql command till I run the command below to resolve it. The command provided below is just a little tweak of what has already been provided by others here. The only difference is, instead of providing a specific postgres version number in the command, you can simply tell postgres to use the latest postgres version by simply running the following command:
export
PATH="/Applications/Postgres.app/Contents/Versions/latest/bin:$PATH"
And now my terminal was able to find the path to postgres when I run which psql.
Hope this helps.
add a comment |
I had the same problem with nothing showing for the which psql command till I run the command below to resolve it. The command provided below is just a little tweak of what has already been provided by others here. The only difference is, instead of providing a specific postgres version number in the command, you can simply tell postgres to use the latest postgres version by simply running the following command:
export
PATH="/Applications/Postgres.app/Contents/Versions/latest/bin:$PATH"
And now my terminal was able to find the path to postgres when I run which psql.
Hope this helps.
add a comment |
I had the same problem with nothing showing for the which psql command till I run the command below to resolve it. The command provided below is just a little tweak of what has already been provided by others here. The only difference is, instead of providing a specific postgres version number in the command, you can simply tell postgres to use the latest postgres version by simply running the following command:
export
PATH="/Applications/Postgres.app/Contents/Versions/latest/bin:$PATH"
And now my terminal was able to find the path to postgres when I run which psql.
Hope this helps.
I had the same problem with nothing showing for the which psql command till I run the command below to resolve it. The command provided below is just a little tweak of what has already been provided by others here. The only difference is, instead of providing a specific postgres version number in the command, you can simply tell postgres to use the latest postgres version by simply running the following command:
export
PATH="/Applications/Postgres.app/Contents/Versions/latest/bin:$PATH"
And now my terminal was able to find the path to postgres when I run which psql.
Hope this helps.
answered Apr 30 '17 at 9:55
Vick SwiftVick Swift
1,5491014
1,5491014
add a comment |
add a comment |
I just experienced the same problem, and solved it by adding export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin
to .bash_profile. Note that this line is version-specific, so be sure to check this line against your current version of Postgres.app.
add a comment |
I just experienced the same problem, and solved it by adding export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin
to .bash_profile. Note that this line is version-specific, so be sure to check this line against your current version of Postgres.app.
add a comment |
I just experienced the same problem, and solved it by adding export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin
to .bash_profile. Note that this line is version-specific, so be sure to check this line against your current version of Postgres.app.
I just experienced the same problem, and solved it by adding export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin
to .bash_profile. Note that this line is version-specific, so be sure to check this line against your current version of Postgres.app.
edited May 23 '17 at 12:34
Community♦
11
11
answered Apr 29 '15 at 2:13
rainbowsorbetrainbowsorbet
371215
371215
add a comment |
add a comment |
On macOS Mojave these instructions work well:
If your Postgres has not been installed yet, I suggest you use the great "brew" package manager from here https://brew.sh/ :
$ brew cask install postgres
or you can install it usual way from the websitePut this to the bottom of your ~/.bash_profile file:
export PATH="/Applications/Postgres.app/Contents/Versions/latest/bin:$PATH"
Restart your terminal or restart your ~/.bash_profile directly with the command:
$ . ~/.bash_profile
Verify your installation:
$ psql --version
add a comment |
On macOS Mojave these instructions work well:
If your Postgres has not been installed yet, I suggest you use the great "brew" package manager from here https://brew.sh/ :
$ brew cask install postgres
or you can install it usual way from the websitePut this to the bottom of your ~/.bash_profile file:
export PATH="/Applications/Postgres.app/Contents/Versions/latest/bin:$PATH"
Restart your terminal or restart your ~/.bash_profile directly with the command:
$ . ~/.bash_profile
Verify your installation:
$ psql --version
add a comment |
On macOS Mojave these instructions work well:
If your Postgres has not been installed yet, I suggest you use the great "brew" package manager from here https://brew.sh/ :
$ brew cask install postgres
or you can install it usual way from the websitePut this to the bottom of your ~/.bash_profile file:
export PATH="/Applications/Postgres.app/Contents/Versions/latest/bin:$PATH"
Restart your terminal or restart your ~/.bash_profile directly with the command:
$ . ~/.bash_profile
Verify your installation:
$ psql --version
On macOS Mojave these instructions work well:
If your Postgres has not been installed yet, I suggest you use the great "brew" package manager from here https://brew.sh/ :
$ brew cask install postgres
or you can install it usual way from the websitePut this to the bottom of your ~/.bash_profile file:
export PATH="/Applications/Postgres.app/Contents/Versions/latest/bin:$PATH"
Restart your terminal or restart your ~/.bash_profile directly with the command:
$ . ~/.bash_profile
Verify your installation:
$ psql --version
edited Jan 24 at 11:48
answered Jan 24 at 11:42
om2c0deom2c0de
36139
36139
add a comment |
add a comment |
On macos mojave i've added the following line on my ~/.profile :
export PATH=$PATH:/Library/PostgreSQL/10/bin
the psql command line client lies into this folder. i've used the enterprisedb installer.
add a comment |
On macos mojave i've added the following line on my ~/.profile :
export PATH=$PATH:/Library/PostgreSQL/10/bin
the psql command line client lies into this folder. i've used the enterprisedb installer.
add a comment |
On macos mojave i've added the following line on my ~/.profile :
export PATH=$PATH:/Library/PostgreSQL/10/bin
the psql command line client lies into this folder. i've used the enterprisedb installer.
On macos mojave i've added the following line on my ~/.profile :
export PATH=$PATH:/Library/PostgreSQL/10/bin
the psql command line client lies into this folder. i've used the enterprisedb installer.
answered Nov 13 '18 at 4:05
SombriksSombriks
1,46932332
1,46932332
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f20928734%2fhow-to-put-psql-on-the-path-when-using-postgres-app-on-os-x%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Please always specify (a) your Mac OS X version, since Apple love changing stuff in random and exciting ways, and (b) What PostgreSQL packaging you are using - homebrew, heroku postgres.app, enterprisedb one-click, macports, etc. Easy to guess in this case, but only because you specified the path.
– Craig Ringer
Jan 5 '14 at 1:12