Bug report
For a column whose type is a DOMAIN, the columns query resolves the column to the domain's base type and never surfaces the domain itself. Both output fields that could carry the type name — format and data_type — collapse to the base type, so downstream consumers (notably the Studio table editor grid) label the column with the base type (text, jsonb, …) instead of the domain name.
Example from CipherStash Encrypt Query Language (EQL):
CREATE DOMAIN public.eql_v3_text_search AS jsonb
CHECK (
jsonb_typeof(VALUE) = 'object'
AND VALUE ? 'v'
AND VALUE ? 'i'
AND VALUE ? 'c'
AND VALUE->>'v' = '3'
);
Creating a table with this type works but the API reports the type as jsonb instead of the domain.
Schema visualizer shows the type as jsonb:
The meta API response:
curl -s "http://127.0.0.1:54321/pg/tables?included_schemas=public" | jq
psql shows the correct domain type name:
psql \d shows the domain name for the same column, because it uses format_type(atttypid) (domain-aware). The Studio "New column" type picker also shows the domain name, because it comes from the types query (format_type(t.oid)). Only the columns path flattens it — so the same type is displayed inconsistently across the UI.
Environment
Bug report
For a column whose type is a
DOMAIN, thecolumnsquery resolves the column to the domain's base type and never surfaces the domain itself. Both output fields that could carry the type name —formatanddata_type— collapse to the base type, so downstream consumers (notably the Studio table editor grid) label the column with the base type (text,jsonb, …) instead of the domain name.Example from CipherStash Encrypt Query Language (EQL):
Creating a table with this type works but the API reports the type as
jsonbinstead of the domain.Schema visualizer shows the type as
jsonb:The meta API response:
{ // ... { "table_id": 23315, "schema": "public", "table": "users", "id": "23315.3", "ordinal_position": 3, "name": "name", "default_value": "NULL::jsonb", "data_type": "jsonb", "format": "jsonb", "is_identity": false, "identity_generation": null, "is_generated": false, "is_nullable": true, "is_updatable": true, "is_unique": false, "enums": [], "check": null, "comment": null } } // ...psqlshows the correct domain type name:psql \dshows the domain name for the same column, because it usesformat_type(atttypid)(domain-aware). The Studio "New column" type picker also shows the domain name, because it comes from thetypesquery (format_type(t.oid)). Only thecolumnspath flattens it — so the same type is displayed inconsistently across the UI.Environment
postgres-metav0.96.1 (bundled with Supabase CLI 2.84.2); also present onmaster@f21a4da.PostgreSQL 15 (Supabase local dev stack) and Supabase hosted.
I confirm this is a bug with Supabase, not with my own application.
I confirm I have searched the Docs, GitHub Discussions, and Discord.