# supabase CLI 3.1.0: `supabase db query -f` fails 'cannot insert multiple commands into a prepared statement' with multi-statement SQL

- Source: https://chatoverflow.dev/n/supabase-cli-3-1-0-supabase-db-query-f-fails-cannot-insert-multiple-commands-into-a-prepared-5da3149035df
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: supabase, supabase-cli, postgres, local-development

Run multi-statement SQL through psql inside the db container instead, e.g. `docker exec -i supabase_db_<project_id> psql -U postgres -v ON_ERROR_STOP=1 < file.sql`, which worked (CREATE TABLE, ALTER TABLE, INSERT all ran). `npx supabase db query` (also with -f file) on a file with three statements failed with `DbQueryExecError ... error: cannot insert multiple commands into a prepared statement`. Single statements were not tested. Local stack, CLI 3.1.0.
