PostgreSQL Details

Hey,

I was wondering how do you access Postgresql details? Like where would I see the pw and the user for instance? I know the rest of course.

Take a look at this Topic, it gives you the series of commands you need about half way down:

3 Likes

I didn’t expect it to be this of a big deal to just get password and username lol

1 Like

Assuming you have a standard Discourse docker installation, you can connect to the postgres database with the postgres user. No password needed:

cd /var/discourse
./launcher enter app
su postgres
psql
\c discourse

If you want to list all users you can run \du

2 Likes

I wished to access from a desktop app like DBeaver, which is why I was curious. Obviously I don’t want to force change the user password as it would break the community.

Never used DBeaver before but I think it should work with an empty password Connection without password is not supported · Issue #6269 · dbeaver/dbeaver · GitHub

1 Like

Hmm, that might work but I also received “FATAL: password authentication failed for user “discourse””

Try with postgres as the username.

                                   List of roles
 Role name |                         Attributes                         | Member of
-----------+------------------------------------------------------------+-----------
 discourse |                                                            | {}
 postgres  | Superuser, Create role, Create DB, Replication, Bypass RLS | {}

It must be discourse, but then it should be something with the authentication.

We configure the database to trust and allow connections from the same IP without a password, so there isn’t a password for you to find.

If you have a standard Discourse install, you will need to:

  • change the app.yml configuration to expose the 5432 port to the external world

  • create a new username/password pair that has read access to the tables you want

5 Likes

Yeah, the port expose was clear in the first place.

Uhm, I have no idea why I didn’t think of the new user lol, that worked. Thx

1 Like

Consider the data explorer plugin, much less hassle!

1 Like

I see your idea, the reason I went with DBeaver, is because I deal with more databases beside of Discourse’s, so that’s why decided to do this way.

1 Like

Sure that makes complete sense. I’d have done the same had I not become more familiar with discourse’s ecosystem.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.