Unable to connect to postgres externally


I created a postgres cluster, assigned an IP, and updated the services to expose port 10000 like the docs said. However when I try to psql locally, it says connection refused. Would you be able to check up on it? The app is called prisma-scale

I believe this is being blocked by our firewall in certain regions. Should be resolved soon (I’m working on it).

How about now?


Hmmm, weird. I did fly pg attach --postgres-app prisma-scale, but I’m getting a permission denied when I try to make a query or insert.

QueryError(Error { kind: Db, cause: Some(DbError { severity: "ERROR", parsed_severity: Some(Error), code: SqlState("42501"), message: "permission denied for table User", detail: None, hint: None, position: None, where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some("aclchk.c"), line: Some(3447), routine: Some("aclcheck_error") }) }) })

Any ideas what it could be?

Can you tell what it’s actually trying to do on the users table there? The permissions we set on attach should give you almost complete control over the DB.

This is a test app I’m building to try messing with the multi-region postgres stuff. I only have two queries:

const users = await prisma.user.findMany();
// and
await prisma.user.create({})

Here’s all the code to it: GitHub - nahtnam/fly-test. All I did was create a db, create an app, deploy, and link. In terms of the db, I also exposed the port and ran the prisma migration on it

Did you run the migration with the same user/connection string your app got after pg attach? This error looks like it might be what happens when a migration is run with the pg root user and the app attempts to connect with a reduced privilege user.

Yes, thats probably what happened. What should I do know? Drop the db and user or will that mess with the link?

EDIT: Dropped the db, dropped the user, and reran the link