supabase / cli

Supabase CLI. Manage postgres migrations, run Supabase locally, deploy edge functions. Postgres backups. Generating types from your database schema.
https://supabase.com/docs/reference/cli/about
MIT License
1.02k stars 201 forks source link

`ERROR: extension "pg_cron" must be installed in schema "pg_catalog"` After `1.169.8` Upgrade #2342

Closed barrownicholas closed 3 months ago

barrownicholas commented 3 months ago

Describe the bug After upgrading the CLI to 1.169.8, I am now getting the following error when trying to run the following command:

Command

create extension if not exists "pg_cron" with schema "extensions";

Error

ERROR: extension "pg_cron" must be installed in schema "pg_catalog" (SQLSTATE 0A000)
At statement 0: create extension if not exists "pg_cron" with schema "extensions"  

To Reproduce Steps to reproduce the behavior:

  1. Upgrade CLI to latest (1.169.8)
  2. Try to enable pg_cron

Expected behavior pg_cron was previously working fine (I'm getting this error in a schema diff from 12/13/2023).

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

        SERVICE IMAGE      │        LOCAL         │ LINKED
  ─────────────────────────┼──────────────────────┼─────────
    supabase/postgres      │ 15.1.1.41            │ -
    supabase/gotrue        │ v2.151.0             │ -
    postgrest/postgrest    │ v12.0.1              │ -
    supabase/realtime      │ v2.28.32             │ -
    supabase/storage-api   │ v1.0.6               │ -
    supabase/edge-runtime  │ v1.53.3              │ -
    supabase/studio        │ 20240514-6f5cabd     │ -
    supabase/postgres-meta │ v0.80.0              │ -
    supabase/logflare      │ 1.4.0                │ -
    bitnami/pgbouncer      │ 1.20.1-debian-11-r39 │ -
    darthsim/imgproxy      │ v3.8.0               │ -
barrownicholas commented 3 months ago

Update 1: is this behavior intentional? I am now seeing the following in the dashboard:

Screenshot 2024-05-29 at 12 34 59 PM
barrownicholas commented 3 months ago

Update 2 (for visibility):

sweatybridge commented 3 months ago

Yup, that is a good fix.

The new Postgres image ships with version 1.6.2 of pg_cron which requires it to be installed in pg_catalog schema.

barrownicholas commented 3 months ago

@sweatybridge thanks for confirming! closing this out.