Pgadmin trying to connect to wrong user on MacOS - postgresql

I'm using Mac OS Big Sur. I changed my user folder and then the issue happened when I tried to start pgadmin server. Pgadmin on web trying to connect to old macos user.
Let's say, I changed my user name from A to B, but pgadmin trying to connect to user A.
How to fix this?

already fixed the issue only with this command
pg_ctl -D /usr/local/var/postgres start

Related

`heroku pg:psql` doesnt work but psql works

Note: I'm on windows.
After installing postgreSQL in my computer trying to use heroku pg:psql gives me this error:
--> Connecting to postgresql-defined-56809
! The local psql command could not be located. For help installing psql, see
! https://devcenter.heroku.com/articles/heroku-postgresql#local-setup
The psql command works and psql --version returns the same version that my database uses on heroku as returned by heroku pg:info.
I have followed the instructions in that link and it still doesn't work (well I did that from the beginning). I even restarted my computer but it still doesn't work.
Edit: found that psql runs in powershell but not in cmd
Okay so after trying to set up the PATH from cmd I think I messed something up and the heroku command didnt work anymore and I reinstalled heroku and now everything works fine. What a waste of time.

Error when opening pgAdmin 4 on mac

I have installed version 4-1.5, but when opening it, it always shows this error "The application server could not be contacted."
I removed the local directory hidden and resolved:
$ cd ~
$ rm -r .pgadmin/
Note: macOS Sierra (10.12.6) and pgAdmin 4-1.6. Also you are going to loose configuration data like database list tree, et al.
The Databases will remain intact since you are modifying/deleting PgAdmin related data not any of Postgresql itself.
I had the same issue, I fixed it by stopping the service in Postgres app, then start pgAdmin, and then start the Postgres service. I was able to connect it after that. Hope this help.
I had same error, but in my case I use wrong port number for the database
On my system Safari is the problem as it was default browser.
To fix, make Chrome your default browser and try relaunching pgadmin4
OR
Manually fix by
$ cat ~/.pgAdmin4.5704814747986328352.addr
http://127.0.0.1:62631/?key=0ec25e6a-dfe2-483e-9814-b315ea87c3cf
Paste what you get in Chrome

Unable to connect to PostgreSQL 9.3

Recently, I have installed PostgreSQL 9.3 on my windows 7 64 bit PC but today I have formatted my PC. Now again I tried to install PostgreSQL 9.3 but after installation when I tried to connect it throws error See below screenshot :-
My pg_hba.conf is shown below :
I have also saw Postgres password authentication fails but nothing helps.
I am new to PostgreSQL,please help me on this.
Finally I found the solution hope this will help to other users if they are facing the same problem :-
I have to edit pg_hba.conf file which is located in "C:\Program Files\PostgreSQL\9.3\data". In that file I have to make method md5 to trust as #Craig Ringer said. So the line will look like host all postgres 127.0.0.1/32 trust.
Then to restart the PostgreSQL on windows - Go to start > run > services.msc then restart the service.
Then open pg Admin create new server enter all the required details and save it. That's it !!

Postgres.app setup for heroku

I'm trying to install Postgres.app on my mac (lion), and running into issues.
I'm trying to follow the instructions here: https://devcenter.heroku.com/articles/heroku-postgresql#local-setup.
So, as the first step I downloaded the app here: http://postgresapp.com/.
Next, I opened the documentation here:http://postgresapp.com/documentation.
When I run $ psql -h localhost, it asks for a password, and I have no idea what the password is supposed to be. Can somebody help with figuring out how to set Postgres.app as the default database for using Heroku?
Thanks.
You're probably using the psql that comes built-in to Mac OS X, thanks to Apple's incredibly frustrating decision to bundle an (old) PostgreSQL on the default port and with its tools on the default PATH.
Check psql --version to see what you're running.
Quite likely you need to set your PATH so it finds the psql from Postgres.app . Or you can check what port Postgres.app is running on and specify a port, though if you use an old psql with a new PostgreSQL then you'll have issues with backslash commands. This is explained just a few paragraphs down in the documentation you were reading.

Push local postgresql database to heroku: The local psql command could not be located

I'm trying to push a local postgresql database to my heroku project. Unfortunately, it doesn't work.
Postgresql works perfectly on my computer and the psql command works as well (Path is set correctly to the bin folder)!
But when I try to push my databse with
heroku pg:push mylocaldb HEROKU_POSTGRESQL_MAGENTA --app sushi
(with my db name as mylocaldb and my real app name), it doesn't work at all.
Problem: The local psql command could not be located
Why? As said before, psql works fine. Even a reinstall of postgresql doesn't help.
The pull statement (see: doesn't work either because postgres always wants to authenticate as my windows user (I don't know how to change the user name when using the heroku pg:pull command, this didn't help: https://devcenter.heroku.com/articles/heroku-postgresql#pg-push-and-pg-pull)
Thanks for your help!
Have you tried calling the psql command with its full path?
For example: /opt/PostgreSQL/9.1/bin/psql
Or if that doesn't help, you can try this