Postgres User
I’m working on a project where I want to avoid using the Supabase master key for security reasons. Instead, I created a dedicated database user with limited permissions to manage specific operations, such as interacting with a subscription management table. My goal is to ensure secure access while adhering to the principle of least privilege.
Here’s what I’ve done so far:
However, when I attempt to execute queries from my backend, I consistently encounter the following error:
Here’s what I’ve done so far:
- Created a new database user with limited permissions.
- Granted necessary privileges on specific tables and sequences for this user.
- Verified the connection using a Postgres client (psql), and the connection works without issues. For example, I’m able to run queries like SELECT * FROM table_name WHERE id = 1 directly in psql.
- Configured my backend (using Dart and Dart Frog) to connect to the database with this user’s credentials.
However, when I attempt to execute queries from my backend, I consistently encounter the following error:
Severity.fatal XX000: Tenant or user not found