Accessing Database

I am trying to access my database via a GUI (Psequel).

I forwarded the port setting from my container as such:

app.yml:

expose:
  <standard definitions>
  - "15432:5432" # PostgreSQL

Also changed my password as such:

./launcher enter app
su - postgres
psql
ALTER ROLE postgres WITH PASSWORD '<your password>';

And I am unable to access the database. Any suggestions?
1 Like

If you only need a static snap shot of the database then from https://<site>/admin/backups download a backup. It should be a *.tar.gz file and when uncompressed will be a *.sql file. Create a PostgreSQL database on another machine, which could even be your laptop, and then import the *.sql file.

Now you should be able to access the data all you want with any means that can connect to a PostgreSQL database.

I use the above but access the Discourse database in PostgreSQL via ODBC.

HTH

1 Like

ok good idea.
Actually I figured it out. It runs on port 5432 also in the container.
it should read:
expose:

  • “5432:5432” # PostgreSQL

thanks

6 Likes

Hi Everyone,

I am able to access my postgres db via pgadmin using the following steps:

  • Remove the expose port code my your app.yml and rebuild the app.
  • Go to your server management portal (i.e Digital Ocean, AWS etc). Create a firewall rule which opens port 5432.
  • Using pgadmin SSH tab: sign into your server using the server address and credentials.

Let me know if this works for you.

Kind Regards,
Kimberly