diff --git a/internal/codegen/golang/postgresql_type.go b/internal/codegen/golang/postgresql_type.go index 563cc09ab9..25493d8150 100644 --- a/internal/codegen/golang/postgresql_type.go +++ b/internal/codegen/golang/postgresql_type.go @@ -577,10 +577,14 @@ func postgresType(req *plugin.GenerateRequest, options *opts.Options, col *plugi } return StructName(schema.Name+"_"+enum.Name, options) } else { + nullPrefix := "Null" + if emitPointersForNull { + nullPrefix = "*" + } if schema.Name == req.Catalog.DefaultSchema { - return "Null" + StructName(enum.Name, options) + return nullPrefix + StructName(enum.Name, options) } - return "Null" + StructName(schema.Name+"_"+enum.Name, options) + return nullPrefix + StructName(schema.Name+"_"+enum.Name, options) } } }