---
title: "Discussion on \"Updating database field to NULL in GORM using struct\" | Hashnode"
description: "Discussion on \"Updating database field to NULL in GORM using struct\". Background\nWhen I was using GORM as the ORM in Go, I discovered that we cannot update a field into NULL with struct, even though we use a pointer as the type.\nFor example, if we set nil to the Name and execute the Updates method in GORM, the name fie..."
url: "https://hashnode.com/posts/updating-database-field-to-null-in-gorm-using-struct/63bd22e3c0b43340548b39ce"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Updating database field to NULL in GORM using struct](https://redhoyasa.hashnode.dev/updating-database-field-to-null-in-gorm-using-struct?utm_source=hashnode&utm_medium=feed)

Background When I was using GORM as the ORM in Go, I discovered that we cannot update a field into NULL with struct, even though we use a pointer as the type. For example, if we set nil to the Name and execute the Updates method in GORM, the name fie...

Jan 10, 2023 · 1 min read · redhoyasa.hashnode.dev  
Read the article

-   [#go](https://hashnode.com/tag/go)
-   [#postgresql](https://hashnode.com/tag/postgresql)

## Written by

[Muhammad Redho Ayassa](https://hashnode.com/@redhoyasa)

@redhoyasa · Jakarta, Indonesia

  
[View profile](https://hashnode.com/@redhoyasa)

Software engineer with 6+ years of experience. Have been spending 5+ years in the fintech &amp; payment products domain. Specialized in backend and have delivered production-grade web app projects as well.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
