Blocked from nicely accessing a PG database?

I haven’t written an admin app yet but I need to see and manage the data in pg.

  • Apparently, we cannot connect to pg from a local app like Postico? Even on the machine where we’re signed in to fly?

The only facility I can find is the pg console (not app console) via fly pg connect. Anyone have any other ideas?

Hi… Typically, flyctl proxy is easiest, although a small number of people have reported nuances in the past…

https://fly.io/docs/postgres/connecting/connecting-with-flyctl/

Leave the command running for as long as you need the tunnel.

(It’s ready for use as soon as you see the Proxying local port ... line.)

1 Like

Thank you. Do you happen to know the syntax for exposing a different local port than the remote one? (I get an error because I’m running postgres locally on 5432.)

$ fly proxy 5432 -a index-flow-db
Error: listen tcp 127.0.0.1:5432: bind: address already in use

So e.g., to use 5433 locally but connect to 5432? I couldn’t find any examples for using fly proxy.

That’s the colon (:) syntax at the bottom of the page. (Easy to miss!)

For local 5433, it would be fly proxy 5433:5432 -a index-flow-db.

1 Like

Excellent - thank you!

1 Like