As someone said, people just don't read the manual of their database past page 100 :) and use "root" when connection to the database from their code.
https://blog.2ndquadrant.com/application-users-vs-row-level-...
As someone said, people just don't read the manual of their database past page 100 :) and use "root" when connection to the database from their code.
https://blog.2ndquadrant.com/application-users-vs-row-level-...
Basically PostgREST translates cryptographically signed JWT claims from the client request into local SQL variables accessible by postgresql's "current_setting" function. The additional claims can identify the user beyond their db role. They can specify, for instance, the user's email address.
Row level security policies can use current_setting to refer to the extra claims. So multiple users can share a db role and connection pooling works fine.
> users are a connection level concept
That is not true. There are users in the db that do not have login privileges.
PostgREST connects in with only one user (authenticator), then for each authenticated request it does `set local role alice` within a transaction, where alice is a db user with no login privileges.
The biggest issue with this is roles are identifiers, which means you can't use parameters for them.