https://supabase.com/ logo
#sql
Title
# sql
c

codart

08/19/2021, 4:09 PM
Can I login with this role? I need full control over my database
b

burggraf

08/19/2021, 8:00 PM
I believe you can only login with user: postgres. What do you need to do that the postgres user can’t?
c

codart

08/20/2021, 1:39 AM
I created a table using supabase ui but cannot set limit on varchar type. Then I tried to connect to db and update that column type manually but postgres complain that I'm not the owner of the table.
p

Peanut

08/20/2021, 2:33 AM
I also need to login as this user to modify an inbuilt net function (http_post). I assume it is restricted intentionally
b

burggraf

08/20/2021, 2:46 AM
If you created a table you should be able to update it. http_post is in the extensions schema I think.
c

codart

08/20/2021, 3:19 AM
@User Yeah, I see. If I create the table then I'm the owner but that's really a bad experience. Supabase table manager is convinient. I wish after creating the table it will grant the owner to
postgres
user so I can modify schema the way I want
b

burggraf

08/20/2021, 3:20 AM
You can change the owner at any time
c

codart

08/20/2021, 3:24 AM
@User really? did I miss something?
b

burggraf

08/20/2021, 3:25 AM
Oh how did you create the table? Not through the Supabase dashboard?
c

codart

08/20/2021, 3:26 AM
Yes, I did create that table via supabase dashboard
b

burggraf

08/20/2021, 3:26 AM
I always create my tables using a query editor in the Supabase dashboard
c

codart

08/20/2021, 3:27 AM
Ah, I not my case, I was using supabase interactive UI
I mean this
b

burggraf

08/20/2021, 3:28 AM
I think you can elevate the postgres user to super user now. But that may not always be possible if they shut it down.
alter user postgres with superuser alter user postgres with nosuperuser
c

codart

08/20/2021, 3:33 AM
impossible, sir. Did you try that command on your supabase db? 🤔
b

burggraf

08/20/2021, 3:34 AM
I ran it a couple weeks ago
Let me try it now
They may have restricted it.
c

codart

08/20/2021, 3:35 AM
Hmm, so weird. That means they restrict it now
b

burggraf

08/20/2021, 3:36 AM
No, it's not restricted.
I just ran it in the query editor in the dashboard and it didn't give any error.
c

codart

08/20/2021, 3:37 AM
I created the project last night. Any chance that the restriction only applies to the newly created preoject?
b

burggraf

08/20/2021, 3:37 AM
Yeah just tried again with a database I created yesterday.
works fine for me in the Supabase dashboard.
Did you try it from the Supabase dashboard SQL Query window?
c

codart

08/20/2021, 3:38 AM
Ah, make sense, let me try
It works perfectly. I guess supabase SQL window executes script as superuser 😂
b

burggraf

08/20/2021, 3:41 AM
k, probably not a good idea to keep postgres as supseruser permanently, but at least you can do what you need.
c

codart

08/20/2021, 3:43 AM
Yeah, thanks for your patients and advices. I'll revert superuser right after done. Thanks again ❤️
b

burggraf

08/20/2021, 3:44 AM
My pleasure -- happy to help!