I want to see the data in tables of my database
is there any way to see data in database like normally we can connect our postgres database to pgAdmin?
If you want to check the tables in your database you can do this:
flyctl ssh console --app postgres-app-here psql -h 127.0.0.1 -U user-you-want-here
psql you can use the command
\d to list the tables in your database.
For accessing it through pgAdmin, it’s a bit different. The database is accessed by your other apps over private networks, so you’ll need to make a tunnel between your computer and the database. You can use Wireguard to create a tunnel. Then you can connect to the database in pgAdmin with the internal address (e.g.
paulgra-ham.internal) and your credentials.
You can read more about how to setup Wireguard with this reference:
can you please help me in it I’m still not sure how to do it I have tried steps over there but it does nothing for me
usama@Usamas-MacBook-Pro chatapp % flyctl proxy 5432 -a my-db usama@Usamas-MacBook-Pro chatapp % psql postgres://postgres:password@localhost:5432 psql (14.1) Type "help" for help. postgres=#
How to connect fly.io postgres to pg_admin any step by step guide please
Did you let the
proxy command keep running? You can’t cancel it, it needs to stay running in a tab.
psql command looks like it might have worked. You could also connect from something like Postico, which is a little easier than a CLI. If you want to use
psql you can actually run:
flyctl pg connect -a <db-name>
Then follow these instructions: psql command line tutorial and cheat sheet | postgres
You’ve forwarded the database port to port 5432 on your computer (localhost).
At this point it’s just a matter of setting up pgAdmin or whatever other client you want to use. Server Dialog — pgAdmin 4 6.5 documentation
I would need the same! I’ve been trying to set up my database in Postico and the pg_admin steps aren’t clear to me
did you found the solution?
This is how I’d set my database to be accessible on localhost.
On your terminal write the command:
$ fly proxy 6543:5432 -a app-name Proxying local port 6543 to remote [app-name.internal]:5432
This command will expose the port 5432 from your app to your localhost:6543 (feel free to change this number)
On your Postico/Client app do this
The host should be
localhost and the port should be the one you choose (in my example 6543).
Read more: Postgres on Fly · Fly Docs
fly proxy 6543:5432 -a app-name
taking to long to respond any idea?
Hi, this solves the connection problem. I can connect to my database using dbeaver client app but unfortunately, I cannot see the tables. How can this be fixed? I am sure tables exist because my app can query database but just I can’t see them.
Thanks, but I can see all databases. Can’t see just tables. Maybe this is a bug of Dbeaver.
This is how you will get the table you’re looking for