diff --git a/internal/codegen/golang/postgresql_type.go b/internal/codegen/golang/postgresql_type.go index 398d01e2e8..56d696daf6 100644 --- a/internal/codegen/golang/postgresql_type.go +++ b/internal/codegen/golang/postgresql_type.go @@ -576,6 +576,11 @@ func postgresType(req *plugin.GenerateRequest, options *opts.Options, col *plugi return StructName(enum.Name, options) } return StructName(schema.Name+"_"+enum.Name, options) + } else if emitPointersForNull { + if schema.Name == req.Catalog.DefaultSchema { + return "*" + StructName(enum.Name, options) + } + return "*" + StructName(schema.Name+"_"+enum.Name, options) } else { if schema.Name == req.Catalog.DefaultSchema { return "Null" + StructName(enum.Name, options)