Tables created via UI are not granted any access privileges
See original GitHub issueBug report
Describe the bug
Tables created via the Supabase UI do not have any access privileges granted and cannot be accessed using either client or service credentials.
To Reproduce
- Create a new table via the supabase UI with default settings (autogen ID and created_at columns). Leave the RLS option deselected.

- Attempt to query the table via a. supabase-js client with client keys b. supabase-js client with service keys c. psql in all cases you will get a permission denied error.
{
hint: null,
message: 'permission denied for table test_table',
code: '42501',
details: null
}
Expected behavior
I should be able to select from a table which has no RLS using both client and service keys.
System information
- Version of supabase-js:
1.20.0
Additional context
psql output below shows that the newly created test_table has no access privileges, but a table created via the UI in the past does have access privileges.
postgres=> \z test_table
Access privileges
Schema | Name | Type | Access privileges | Column privileges | Policies
--------+------------+-------+-------------------+-------------------+---------------------------------
public | test_table | table | | | Enable access to all users (r):+
| | | | | (u): true
(1 row)
postgres=> \z profile
Access privileges
Schema | Name | Type | Access privileges | Column privileges | Policies
--------+---------+-------+--------------------------------+-------------------+-------------------------------------------------------
public | profile | table | postgres=arwdDxt/postgres +| | Profiles are viewable by users who created them. (r):+
| | | anon=arwdDxt/postgres +| | (u): (auth.uid() = uid)
| | | authenticated=arwdDxt/postgres+| |
| | | service_role=arwdDxt/postgres | |
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Grant permissions to user for any new tables created in ...
Found the answer. It is in this line in the ALTER DEFAULT PRIVILEGES documentation. You can change default privileges only for objects that ......
Read more >Group not inheriting access privileges for all tables
When I create a table as user a , the readonly user can access it. But when I create the table as user...
Read more >Why can't role ACCOUNTADMIN access new tables created ...
Since this is a development user, it does not grant any privileges at all to other users or roles. Once development is complete, ......
Read more >Granting Permissions to Database Objects - Civis Analytics
To revoke privileges from a database object, use the REVOKE command. Permissions for schemas and tables are separate. To grant access to “demo....
Read more >How to manage the user access rights to see database views ...
A very simple way is to use the following T-SQL script that will create a database role, it will also add the views...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
My workaround for this issue was to grant privileges for this new table manually:
Thanks, can you file a support request at https://app.supabase.io/support/new?