The table owner has always been supabase_admin for...
# off-topic
g
The table owner has always been supabase_admin for me in sql editor or table editor. Were you using another database manager and linking into to postgres to create your tables?
r
Hey, All my other tables have the owner assigned to
postgres
user
I've only been using the supabase dashboard to create my tables
g
hmmm
r
In pgadmin I cant view the table properties for the new table
or even do a basic Select query
I can only assume it's because the table owner is assigned to supabase_admin?
I dont know if my issue is related to this https://github.com/supabase/supabase/issues/3415
But everything was working up until yesterday
g
I think the table owner gets assigned thru the schema public, but I'm not sure of the details. I looked on my older instance and I have a mix of tables owners with newer tables being supabase_admin and older ones being postgres.... BUT I may have changed owner on them so I could use them with datagrip over the connection.
r
is there a way to change the table owner?
g
ALTER TABLE public.myname_record OWNER TO postgres
r
im pretty sure I'm gonna a permission denied error but I'll try anyway
g
You have to be supabase admin to do it, so from sql editor
r
ok that seemed to have worked
but who should the default owner be for new tables?
g
supabase_admin is the user for the studio ui for database/table editor and sql window, so that will be owner.
r
so if i create a new table via pgadmin then the table owner will be
postgres
?
g
yes
r
then if I created a new table via the supabase dashboard, do i have to change the table owner to
postgres
if I want to view the table in pgadmin?
g
You can view the table, just limits on what you can do to it.
structurally
r
ok thanks for the help
I really appreciate it
one last thing
I tried doing
Copy code
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO postgres;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO postgres;
so that should give postgres user access to all tables right?
even if owner is supabase_admin?
g
Supabase has the public schema set up to automatically give all the needed users access (auth,authenticated, postgres, etc) to created tables in public.
r
hmm ok
thanks
I’m wondering if you did something that impacted public schema settings. Tables created in public should be readable/writeable by all users even if owned by. Supabase_admin. The owner aspect should impact changing the structure of the table.
r
I think I know what could've happened
I backed up my supabase db and then restored it in pgadmin
and then I made some changes to the local db and then restored my supabase postgres db with the updated local db
I dont know if that was the reason why all my previous tables had ownership of
postgres
but I suspect it is
Oh you know what
Cause when I restore the supabase db in pgadmin I first have to delete the schema.public in my local db first
And then i guess when it restores the supabase db in pgadmin it assigns the tables to postgres user
Hopefully that makes sense