Connecting locally to a HerokuConnect Postgres database - postgresql

I'm building a simple web app that will deploy on Heroku, and using a Postgres database that is filled with an object from Salesforce. I did that with HerokuConnect and that works.
Now I want to see the contents of the database so that I know the table names, and I already know you can't do that on Heroku itself. So, I tried to connect to the database locally via heroku pg:psql but everytime I do that I get the error:
---> Connecting to DATABASE_URL
DL is deprecated, please use Fiddle
psql: could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "***.***.***.**" (**.***.***.***) and accepting
TCP/IP connections on port ****?
So that doesn't work. I tried the following but to no avail:
explicitly specifiying the name of the database
specifying host, user, database name, password, port and setting sslmode=require per the user guide and this question about connecting to a heroku postgresql database.
using the method above, but instead of using heroku psql I just used psql. That asked for a password but for a user I never created (a user with my corporate system name, because this is a corporate laptop)
reinstalling Postgres
Running heroku pg:info correctly lists my database information.
I am missing something, but I don't know what it is.

"DL is deprecated, please use Fiddle" is not an error but it's only a warning.
This is due to an issue with Ruby 2 on Windows.

Related

java.net.UnknownHostException: when trying to connect to heroku postgres through intellij

I have just signed up to a free heroku account hoping to try and see if a web app I am making functions properly, all works fine on my local machine connected locally to my postgres db.
I am trying to connect to the heroku postgres db I set up. I have connected fine through pgadmin and also in the application.yaml file so that when in prod profile, it runs on the heroku postgres database.
But if I try and connect to the DB using the intellij database connection, I keep getting an error,
[08001] The connection attempt failed. java.net.UnknownHostException: ec2-54-73-110-26.eu-west-1.compute.amazonaws.com
I have checked everything several times, and all the fields on the database connection wizard are correct. I have also set ssl to true, sslmode to verify-ca and sslfactory to sslfactory:org.postgresql.ssl.NonValidatingFactory
but I get the above error each time.

AWS RDS Postgres 11 database Connected to pgAdmin 4

Question
What extra do I get if I fix this and get access to the admin database? (MyDataBaseName normal database works perfectly well)
Do I even need to fix this to use this postgres database for a Django 3.0 project?
Done -> ERROR
I have created a free tear AWS RDS Postgres 11 database.
I allowed external connections at creation and have successfully configured the inbound rules.
Than I have connected to pgAdmin (right click on server groups/create/server)
Than I got 3 database:
MyDataBaseName how I have named my database
postgesql that is auto generated
rdsadmin this is also auto generated,
I have problem with this one that it doesn't opens,
it has a rex x at the database icon
if i click on it it gives the following ERROR message
INTERNAL SERVER ERROR
FATAL: SomeConfigFileName.conf rejects connection for host "host.ip.adders.actully.with.numbers", user "myPersonalUsername", database "rdsadmin", SSL on
FATAL: SomeConfigFileName.conf rejects connection for host "host.ip.adders.actully.with.numbers", user "myPersonalUsername", database "rdsadmin", SSL off
"rdsadmin" is used for internal purposes by AWS. There should be no need to "fix" this.
The only things you are missing is things you aren't allowed to do anyway, and indeed not needing to deal with them yourself is what you are paying Amazon for.
Django shouldn't care. If it demands access to this database, that would be a bug in Django (or a configuration error)

Postgres - connection timeout

When I trying connect to my postgres database, I always receiving connection time out error. For instance I want to connect from pqadmin. Can you please help with it ?
PostgreSQL databases on PythonAnywhere are protected by a firewall, so external computers can't access them directly -- you need to use a thing called an SSH tunnel, which opens a secure SSH connection to PythonAnywhere, then sends the Postgres stuff over it.
This help page on the PythonAnywhere site has the details on how to set that up.

How do I connect to the Divio postgres database with local PgAdmin?

I am trying to connect with PgAdmin to the local Divio database in the container but PgAdmin 4 will not let me connect without a password. The Divio Postgres database seems to come without a password.
Has anyone got round this?
You don't need a password.
See Interact with the local database from your host environment in the official documentation.
The key things are:
expose the database’s port by editing the docker-compose.yml file
use the correct credentials
Both steps are described in more detail in the documentation. I haven't given more specific details here such as port numbers in case those details ever change in the future.

Heroku Postgres can't connect from heroku app

So I have a go rest api running on Heroku. I had the free tier version but now we have moved the app to production and upgraded to a standard-0 database. None of my code changed the only thing that changed were environmental variables to connect to the database. However, when I try to connect to the database I get this error:
[BRONZE] [5-1] sql_error_code = 28000 FATAL: no pg_hba.conf entry for host "54.234.***.***", user "ub21ndj3*****", database "d8useg2o3****", SSL off
From my understanding its an SSL issue. What I don't understand is my app is running on Heroku servers so I shouldn't need to create a tls config to connect to the database and the same code was working with the previous database. Would there be another issue why I'm getting this error?
Heroku's standard databases and above require SSL connections as of April, 2016. You can see the Changelog entry here. You were able to use the same application code on a hobby database because they do not have the same restriction.