Can I login with this role? I need full control ov...
# sql
c
Can I login with this role? I need full control over my database
b
I believe you can only login with user: postgres. What do you need to do that the postgres user can’t?
c
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
I also need to login as this user to modify an inbuilt net function (http_post). I assume it is restricted intentionally
b
If you created a table you should be able to update it. http_post is in the extensions schema I think.
c
@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
You can change the owner at any time
c
@User really? did I miss something?
b
Oh how did you create the table? Not through the Supabase dashboard?
c
Yes, I did create that table via supabase dashboard
b
I always create my tables using a query editor in the Supabase dashboard
c
Ah, I not my case, I was using supabase interactive UI
I mean this
b
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
impossible, sir. Did you try that command on your supabase db? 🤔
b
I ran it a couple weeks ago
Let me try it now
They may have restricted it.
c
Hmm, so weird. That means they restrict it now
b
No, it's not restricted.
I just ran it in the query editor in the dashboard and it didn't give any error.
c
I created the project last night. Any chance that the restriction only applies to the newly created preoject?
b
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
Ah, make sense, let me try
It works perfectly. I guess supabase SQL window executes script as superuser 😂
b
k, probably not a good idea to keep postgres as supseruser permanently, but at least you can do what you need.
c
Yeah, thanks for your patients and advices. I'll revert superuser right after done. Thanks again ❤️
b
My pleasure -- happy to help!