Custom PostgreSQL LOGIN role fails via Session Pooler — guidance needed #52542
Replies: 3 comments
|
yes, the shared session pooler supports custom roles. for yours, the username is copy the host from your project's Connect > Session pooler string, keep port what exact error do you get with that configuration? keeping the dedicated owners makes sense here. if your migration login already has permission to switch to whoever can replace that function can change code running with its owner's privileges, so that deployment access is a separate security decision from the restricted bootstrap login |
|
Your four questions, in order, with the short version first: the Session Pooler does not authenticate custom 1. Does the Session Pooler support custom LOGIN roles? Not until the tenant is reconfigured. The shared pooler authenticates the users its tenant carries — the managed roles ( 2. Correct username format. For the shared pooler it is 3. Requirements/limitations for custom roles. The role needs 4. Recommended secure alternative. The direct connection: it speaks Postgres's protocol to your database host with no pooler in the path, so no allowlist applies. Then grant fg_store_invite_server to postgres; -- you must hold ADMIN OPTION, i.e. have created the roleFor a bootstrap operation specifically, the pattern I would use rather than a login role at all: a On the ticket: with SU-531244 already open, the useful addition is the fresh-role test — create |
|
One correction for anyone reading later: custom LOGIN roles are supported on the shared pooler, so there shouldn't be a per-project allowlist you need Supabase to add the role to. The connection docs say that when you connect as a custom role through the shared pooler, the username is In the open-source Supavisor code, the pooler doesn't keep a fixed list of users. It looks up the connecting role's stored password in your database (
For the migration part, the earlier reply is right: If all five check out and it still fails, ask support in your existing ticket for the Supavisor log line for that attempt. The open-source code logs different messages for "wrong password" and "password was recently changed", which narrows it down quickly. |
Uh oh!
There was an error while loading. Please reload this page.
Custom PostgreSQL LOGIN role fails via Session Pooler — guidance needed
Hi Supabase team and community,
I'm working on an independent e-commerce project using Supabase and encountered a PostgreSQL authentication issue.
Related support ticket: SU-531244
Issue 1 — Custom role authentication
We created a restricted PostgreSQL role,
fg_store_invite_server, intended for a controlled administrative bootstrap operation.However, authentication through the Supabase Session Pooler fails for this custom LOGIN role.
We would like to understand:
Issue 2 — Applying a versioned migration
We also have a locally tested SQL migration that needs to replace existing
SECURITY DEFINERfunctions.Some functions are owned by dedicated PostgreSQL roles, including
fg_store_catalog.The default
postgresconnection previously tested did not have the necessary privileges to replace functions owned by this role.We would like guidance on the supported procedure for applying this migration while preserving function ownership, permissions and security boundaries.
Current safeguards
Could you recommend a supported and secure approach for these two issues?
Thank you!
All reactions