SupaScript icon indicating copy to clipboard operation
SupaScript copied to clipboard

install error: Failed to run sql query: permission denied to set parameter "plv8.start_proc"

Open happyboy2022 opened this issue 2 years ago • 6 comments

I copied the contents of the file EASY-INSTALL-V1.5.SQL into a Supabase SQL editor and executed it. However, I received an error: 'Failed to run SQL query: permission denied to set parameter "plv8.start_proc".' Upon reviewing the Supabase documentation, it appears that obtaining superuser access in Supabase isn't possible. Could you shed some light on this issue?

happyboy2022 avatar Jun 14 '23 21:06 happyboy2022

I just spun up a new Supabase project and ran the EASY-INSTALL-V1.5.SQL in a query window, and it worked just fine for me. Is your project an older one, or have you modified the permissions for it?

burggraf avatar Jun 15 '23 14:06 burggraf

Thank you very much for your response.

I found that when I created a new Supabase project, I was able to successfully execute EASY-INSTALL-V1.5.SQL the first time. However, when I tried to execute it again, I received the following error message: Failed to run SQL query: permission denied to set parameter "plv8.start_proc".

It appears that the command I ran the first time was: ALTER DATABASE POSTGRES SET PLV8.START_PROC TO 'supascript_init' ; Although I have superuser privileges, I seem to have lost permission to run this command the second time. I am still struggling with this issue.

happyboy2022 avatar Jun 15 '23 21:06 happyboy2022

Thank you for your answer, we found the problem is to execute the following code, after removing it, it can run normally. CREATE EXTENSION IF NOT EXISTS "plv8" WITH SCHEMA "pg_catalog";

HarveySupper avatar Jun 16 '23 07:06 HarveySupper

Awesome, @HarveySupper! Can you clarify the exact steps you're performing here so I can add this to the docs? I appreciate it!

burggraf avatar Jun 16 '23 13:06 burggraf

SET PLV8.START_PROC = 'supascript_init'; ALTER DATABASE POSTGRES SET PLV8.START_PROC TO 'supascript_init'; According to the current test situation, it should be that we do not have permission to change the value of PLV8.START_PROC, we can only initialize the setting once, and the second time the setting will prompt Failed to run SQL query: permission denied to set parameter "plv8.start_proc". So I executed the SET PLV8.START_PROC at the very beginning.

HarveySupper avatar Jun 19 '23 06:06 HarveySupper

Yes, this can only be executed at the beginning of the initial project: ALTER DATABASE POSTGRES SET PLV8.START_PROC TO 'supascript_init'; Otherwise, an error will occur: Failed to run SQL query: permission denied to set parameter "plv8.start_proc". Also, this SQL code should be placed at the very beginning of the SQL migration file to ensure normal local development. Currently, I can use this as a temporary solution.

I am not sure if Supabase will fix this issue in future versions. If Supabase provides developers with a database account : postgre that has higher permissions, perhaps there won't be such problems.

In any case, thank you all for your assistance with this issue.

happyboy2022 avatar Jun 20 '23 13:06 happyboy2022