Skip to content

Migrations break when a BEGIN ATOMIC statement includes CASE #3474

Closed as not planned

Description

@icopp

Describe the bug
When a migration contains a BEGIN ATOMIC function that includes CASE ... END, the migration fails with syntax error at end of input (SQLSTATE 42601).

To Reproduce
Steps to reproduce the behavior:

  1. Create a new migration with a function like
    CREATE FUNCTION test RETURNS BOOLEAN LANGUAGE sql 
    BEGIN ATOMIC 
    SELECT CASE
        WHEN TRUE THEN TRUE
        ELSE FALSE
    END;
    END;
    
  2. Attempt to run the migration

Expected behavior
The migration should succeed.

Screenshots
n/a

System information
Rerun the failing command with --create-ticket flag.

  • Ticket ID: 629e9f7399a14614a7d2a5a7233f4729
  • Version of OS: macOS 15.4
  • Version of CLI: 2.20.12
  • Version of Docker: 27.5.1
  • Versions of services:
    supabase/postgres      | 15.8.1.060       | -      
    supabase/gotrue        | v2.170.0         | -      
    postgrest/postgrest    | v12.2.8          | -      
    supabase/realtime      | v2.34.45         | -      
    supabase/storage-api   | v1.19.3          | -      
    supabase/edge-runtime  | v1.67.4          | -      
    supabase/studio        | 20250317-6955350 | -      
    supabase/postgres-meta | v0.88.2          | -      
    supabase/logflare      | 1.12.0           | -      
    supabase/supavisor     | 2.4.14           | -  
    ```
    
    

Additional context
If applicable, add any other context about the problem here.

  • Version of Node.js: v22.12.0

Activity

  1. github-actions commented on Jun 17, 2026

    @github-actions
    Contributor

    Hi! Thanks for opening this issue.

    We're closing this because it has not had any activity for 45 days, and we try to keep the Supabase CLI issue tracker focused on reports that are still current.

    If this still reproduces on the latest Supabase CLI, please comment with /reopen on its own line and include your CLI version, updated reproduction steps, and any recent error output. We appreciate the signal and are happy to take another look.

  2. added
    stale-closed
    on Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stale-closed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions