ERROR: type "geography" does not exist (SQLSTATE 42704) when running `db diff`
Describe the bug
supabase db diff is not completing successfully, and cannot see the geography type which is a postgis plugin type.
I've verified that both my remote and local databases have the type registered as \dT geography will return:
postgres=> \dT geography
List of data types
Schema | Name | Description
------------+-----------+------------------------------------------------------------------------------------------------------
extensions | geography | postgis type: The type representing spatial features with geodetic (ellipsoidal) coordinate systems.
(1 row)
I have a few different schemas outside of public, and I'm wondering if this is causing the issue specifically. I have a schema called hydrology which has a table called access_point and uses a geography datatype column.
To Reproduce Steps to reproduce the behavior:
- Create a new schema
- Use the postgis extension
- Create a column that uses the geography datatype
- Run
supabase db diff
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
System information
Rerun the failing command with --create-ticket flag.
- Ticket ID: 08653da6aa94443e944cb8866d3243c4
- Version of OS: Windows 10
- Version of CLI: v1.165.0
- Version of Docker: v24.0.7 build afdd53b
- Versions of services:
-
SERVICE IMAGE │ LOCAL │ LINKED
─────────────────────────┼──────────────────────┼──────────── supabase/postgres │ 15.1.1.78 │ 15.1.1.78 supabase/gotrue │ v2.156.0 │ v2.158.1 postgrest/postgrest │ v12.2.2 │ v12.2.2 supabase/realtime │ v2.28.32 │ - supabase/storage-api │ v1.6.8 │ v1.6.8 supabase/edge-runtime │ v1.45.2 │ - supabase/studio │ 20240422-5cf8f30 │ - supabase/postgres-meta │ v0.80.0 │ - supabase/logflare │ 1.4.0 │ - bitnami/pgbouncer │ 1.20.1-debian-11-r39 │ - darthsim/imgproxy │ v3.8.0 │ -
I have a similar issue. I have enabled plv8 manually via Supabase Studio on my local, but running db diff i will get this error:
ERROR: language "plv8" does not exist (SQLSTATE 42704)
I am also having this issue v2.20.10. Was there ever a solution to this issue?
I had this same issue when starting supabase after stopping without a backup. To solve it, I simply enabled the plv8 extension at the top of my first migration file:
create extension plv8;
docs here: https://supabase.com/docs/guides/database/extensions/plv8?queryGroups=database-method&database-method=sql&queryGroups=language&language=sql