How to set a field to NULL?

Answered

I'm in DataGrip 2017.2 and can't find a way to set a field to null.

 

I read it was "right mouse click" on the field and select "Set to NULL", but it doesn't exist on the version I'm on.

8 comments
Comment actions Permalink

If the field is defined to be NOT NULL then "Set NULL" is not available. What is available in this case is "Set Default" (Ctrl+Alt+D).

However if the field allows a NULL value then "Set NULL" is available via right-click on a cell, or by Ctrl+Alt+N.

3
Comment actions Permalink

@Nomandme Hi,

Could you specify a database vendor you use and a sample DDL for a table you're trying to "Set To NULL"?
Thank you.

0
Comment actions Permalink

This doesn't work. My field allows NULL values. No "Set NULL" in right-click menu nor does Ctrl+Alt+N work, Using version 2017.2.2

Using DataGrip for postgre.

UPDATE

Randomly it started to work again :)

1
Comment actions Permalink

year 2023 same issue

0
Comment actions Permalink

Could you please attach screenshot with the issue? What is field type? It seems to be working fine on my side.

0
Comment actions Permalink

Hello, I'm a DataGrip user currently on 2023.1.1. I googled this issue after I encountered it myself. I have a table with a varchar column that allows null values, but I found that after it had been set to some value that I could not later reset the value to null with DataGrip via the right-click menu; the option wasn't there.

I have FIXED this issue for myself by refreshing the table from the Database Explorer pane. I noticed that my DataGrip was missing several columns in the table that had been added since I started working. Once I refreshed and the table definition was up-to-date in DataGrip, then the "set null" option reappeared in my right-click menu.

Hope this helps!

0
Comment actions Permalink

Hi Jtortorelli03

Please provide more details about this behavior as well as your database. If a column has a null (not null) property specified, do you add rows or do |you change the tables DDL and later, find out the property is not retained? We'll need an example in order to reproduce this issue.

0

Please sign in to leave a comment.