Can't connect to local Postgres (localhost:5432)
This seems like it should be a very basic problem to fix but it's driven me to the brink of madness and cost me days of work.
I'm trying to run my integration tests locally but they're failing due to a PSQLException in connecting. In my terminal, I'm pinging localhost fine and I can successfully telnet to 5432. I can get to the local DB using Postico as well. To try to get at this problem, I'm trying to configure a database within IDEA. It's pretty elementary. The URL is jdbc:postgresql://localhost:5432/postgres and all the other settings match my successful Postico configuration. I haven't changed anything in the Drivers tab; the PostgreSQL driver is 42.6.0, the latest stable. (I tried a few older ones, including all the way back to 9.x; no dice.) We use PostgreSQL 13.10.
This is especially puzzling because everything was fine last week, then I opened up my computer on Monday and it's all broken. I have 2023.2, but this issue was happening before that. I even completely uninstalled IDEA and deleted all of the JB settings from ~/Library to start again, but no change. Hoping to find some insights here, as my team and I are completely out of ideas short of an exorcism. Thanks.
Please sign in to leave a comment.
Hi Tyler Hinman
Please upload the idea log from Help - Show Log in Files onto our FTP server:
uploads.jetbrains.com/
Provide the upload id in your reply. We'll have a look.
Thanks!
2023_08_03_SqXMjeQZ8VKrkeCFTBGBJA (file: idea.log)
Thanks Tyler Hinman
Can you create a new Postgres data source from scratch in IDEA and test the connection? See if this solves the issue.
That's pretty much what I did when I wiped and reinstalled IDEA, but I tried again just in case. Same result.
This was the problem. No idea why it suddenly broke when I didn't touch it at all, but here we are. https://stackoverflow.com/a/76838451/12027515