© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•2mo ago•
3 replies
Kirill

ERROR: cannot insert multiple commands into a prepared statement

CLI
When using supabase db diff command all my declarative schemas generate the baseline migration. And then supabase db reset chokes with this error.

ERROR: cannot insert multiple commands into a prepared statement (SQLSTATE 42601)                                          
At statement: 317                                                                          CREATE OR REPLACE FUNCTION public.consume_book_credits_atomic(p_user_id uuid, p_project_id uuid, p_credits_to_consume integer)                                                                                                                                                                                      
 RETURNS void                                                                                                                                                                                                                                                                                                       
 LANGUAGE plpgsql                                                                                                                                                                                                                                                                                                   
 SECURITY DEFINER                                                                                                                                                                                                                                                                                                   
 SET search_path TO ''                                                                                                                                                                                                                                                                                              
AS $function$ 
ERROR: cannot insert multiple commands into a prepared statement (SQLSTATE 42601)                                          
At statement: 317                                                                          CREATE OR REPLACE FUNCTION public.consume_book_credits_atomic(p_user_id uuid, p_project_id uuid, p_credits_to_consume integer)                                                                                                                                                                                      
 RETURNS void                                                                                                                                                                                                                                                                                                       
 LANGUAGE plpgsql                                                                                                                                                                                                                                                                                                   
 SECURITY DEFINER                                                                                                                                                                                                                                                                                                   
 SET search_path TO ''                                                                                                                                                                                                                                                                                              
AS $function$ 
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

prepared statement s0 already exists
SupabaseSSupabase / help-and-questions
4y ago
Unable to insert into a table
SupabaseSSupabase / help-and-questions
4mo ago
Statement timeout error
SupabaseSSupabase / help-and-questions
3y ago
Error: cannot find parent statement on pldbgapi2 call stack
SupabaseSSupabase / help-and-questions
6mo ago