diff --git a/src/NSchema.Postgres/NSchema.Postgres.csproj b/src/NSchema.Postgres/NSchema.Postgres.csproj
index 339ed5d..c8ed1c2 100644
--- a/src/NSchema.Postgres/NSchema.Postgres.csproj
+++ b/src/NSchema.Postgres/NSchema.Postgres.csproj
@@ -20,7 +20,7 @@
true
true
snupkg
- 5.0.0-alpha.6
+ 5.0.0-alpha.7
$(Version.Split('-')[0])
$(Version.Split('-')[0])
true
diff --git a/src/NSchema.Postgres/Sql/PostgresDatabaseIntrospector.cs b/src/NSchema.Postgres/Sql/PostgresDatabaseIntrospector.cs
index 2ca17c8..6640369 100644
--- a/src/NSchema.Postgres/Sql/PostgresDatabaseIntrospector.cs
+++ b/src/NSchema.Postgres/Sql/PostgresDatabaseIntrospector.cs
@@ -1831,8 +1831,9 @@ private static SqlType MapSqlType(string dataType, string udtName, string? udtSc
"uuid" => SqlType.Guid,
"bytea" => SqlType.VarBinary(),
// A user-defined type (enum, composite, …): preserve its schema so the type round-trips, collapsing
- // the default schema the same way a domain does.
- _ => udtSchema is null or "public" ? SqlType.Custom(udtName) : SqlType.Custom(udtSchema, udtName),
+ // the default schema the same way a domain does. Built-ins outside the switch (jsonb, inet, …)
+ // also land here with udt_schema = pg_catalog, so collapse that too.
+ _ => udtSchema is null or "public" or "pg_catalog" ? SqlType.Custom(udtName) : SqlType.Custom(udtSchema, udtName),
};
}
diff --git a/tests/NSchema.Postgres.Tests/Sql/PostgresDatabaseIntrospectorTests.cs b/tests/NSchema.Postgres.Tests/Sql/PostgresDatabaseIntrospectorTests.cs
index 68811f2..5bfd766 100644
--- a/tests/NSchema.Postgres.Tests/Sql/PostgresDatabaseIntrospectorTests.cs
+++ b/tests/NSchema.Postgres.Tests/Sql/PostgresDatabaseIntrospectorTests.cs
@@ -820,6 +820,21 @@ await Exec($"""
column.Type.ShouldBe(SqlType.Custom(_schema, "order_status"));
}
+ [Fact]
+ public async Task GetDatabase_BuiltInFallthroughColumn_MappedUnqualified()
+ {
+ // Arrange — jsonb also hits MapSqlType's fall-through, but its pg_catalog udt_schema
+ // must collapse so the type reads as declared.
+ await Exec($"""CREATE TABLE "{_schema}".events (payload jsonb NOT NULL);""");
+
+ // Act
+ var column = (await Introspect(_schema))
+ .Schemas[0].Tables.ShouldHaveSingleItem().Columns.ShouldHaveSingleItem();
+
+ // Assert
+ column.Type.ShouldBe(SqlType.Custom("jsonb"));
+ }
+
// ── Sequences ─────────────────────────────────────────────────────────────
[Fact]