Postgresapp: Could not open Terminal

Created on 11 Jun 2019  路  19Comments  路  Source: PostgresApp/PostgresApp

I'm using Mojave 10.14.5. I first installed Postgres using Homebrew. Then instructions recommended removing the installation. I did that, then on first installation of Postgres.app, I didn't grant permission to my Terminal. I've tried uninstalling and reinstalling, and Resetting Postgres.app as described in the troubleshooting documentation. I don't know where to find the .profile file to edit the settings there. Regardless, I keep on receiving the message, "Make sure that Postgres.app has permission to automate Terminal."

bug

Most helpful comment

OK, the update is released. Can you try updating to the latest version (Postgres.app 2.3.3c) and see if it fixes the problem for you?

All 19 comments

To connect to the database, you don't need to give Postgres.app permission to automate Terminal. You can just start psql from Terminal by yourself. If you've set up your $PATH correctly (see docs), and you haven't changed the port, you can just type psql to connect to your PostgreSQL database.

If you do want to use the feature in Postgres.app where you double click on the database to connect, please open System preferences, go to "Security" -> "Privacy" -> "Automation" -> "Postgres" and enable automation of Terminal.

That works, thanks Jakob.

@jakob I have same trouble. Could not open Terminal when i double click the icon to connect database. And in "Security" -> "Privacy" -> "Automation" i don't find "Postgres" or other application. Here are my screen shot.
Mac os version 10.14.6 (18G103)
PostgreSQL.app version 2.3.2 (63)
And i never install any postgreSQL application on my mac.
Thanks for your watching.
Screen Shot 2019-12-07 at 22 02 02

Same as @vose2008

If you configured your $PATH correctly (as explained on the postgres.app homepage), and you use the default port, you can just type psql in terminal to connect to Postgres.app

Yes, i can use psql to connect to Postgress.app but can i just use double click to connection ?

Can you open Console.app, and then try to double click a database in Postgres.app? If the problem is a Sandbox issue, you would see an error message printed there.

Alternatively, you can also try launching Postgres.app from the command line (instead of double clicking the app, launch the binary from the command line by typing /Applications/Postgres.app/Contents/MacOS/Postgres). Then you would also see log messages from Postgres.app, maybe an error message is printed when opening Terminal.app fails.

Hey, jakob. It's work double click can connect the database by launch Postgres.app from Terminal.
But I'm got you mind about open Console.app, and here are my screen shot. May can help you solve this issue. And yes! Postgres.app are really cool and useful and easy to go! Thank you and your team!

------------WORK by Terminal-------------

Screen Shot 2019-12-11 at 17 01 18

------------Fuzz about console------------

Screen Shot 2019-12-11 at 17 05 51

The last line in the console looks similar to the error message reported here:
https://github.com/macvim-dev/macvim/issues/821

Maybe we just need to set NSAppleEventsUsageDescription in Info.plist

Thank you @jakob for showing us all the many alternative ways which we can access our postgresQL server. I believe the real issue though is that the "Feature" of double clicking the server icon, (which has been deliberately developed by the psql team) is not functioning properly and the "System Preferences" -> "Security" -> "Privacy" -> "Automation" does not allow for Terminal or iTerm2 to link with the Postgres macOS application even when the .profile file has the correct PATH.

Thank you.
image

@JMEssex Yes, I understand. I think it's because we're missing the key in the Info.plist. I'm currently working on an update to fix this.

OK, the update is released. Can you try updating to the latest version (Postgres.app 2.3.3c) and see if it fixes the problem for you?

@jakob Thank you! It works for me and my co-worker.

Cool ! Now app work very well. Thank you ~~ XD

@jakob Might there have been some regression here? I installed 2.3.3e today
image

but I can no longer click the database and open it.
image

Before this morning it was working fine, and I am able to run psql from the terminal and connect without issue, and I've enabled Postgres automation to terminal.

@NerdtureUs Ugh, I thought I had finally fixed this issue...

  • How did you install the new version? Did you download it manually, or did you use the automatic update function? If you downloaded it manually, where did you download it from?

  • Which version of macOS are you on?

  • Which version of 2.3.3e are you using, ie. which of the three versions offered from https://postgresapp.com/downloads.html ?

@NerdtureUs
I just tested all three downloads from https://postgresapp.com/downloads.html, and they all work on macOS 10.14.6.

Just to make sure it's not one of those random code signing failures, can you try restarting your Mac, and see if the issue persists?

Is anything written to Console.app when you double click the database and the error is shown? (You need to open Console.app before triggering the warning to enable more detailed logging)

@jakob Thanks for getting back so quickly.
I installed with the automatic update and running mac os 10.15.2 (19C57) with Postgres version 2.3.3e (68)

After the reboot, there was a system confirmation that showed up, to allow Postgres access to the terminal, which wasn't there previously. Once granted, I am able to click the database to launch and connect.

Hi I can connect to Postgres by typing psql on the therminal. I am using the fish shell. however only the \q command works. nothing else (for eg. the \l command) seems to work . The error message is as follows - sh: more: command not found

Was this page helpful?
0 / 5 - 0 ratings