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.

0
11 comments
Avatar
Permanently deleted user

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

@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
Avatar
Permanently deleted user

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

year 2023 same issue

0

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

0

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

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

I have the same problem in IDEA 2023.1.5. If a column in a table is VARCHAR, i simply cannot set null value to it. Writing "<null>" simply inserts this string as a value. There is no "Set null" option in context menu.

0

saldmy Make sure to update the IDEA to the latest version 2023.2 - If the issue persists, open a new YouTrack report at https://youtrack.jetbrains.com/newIssue?project=DBE

0

Hello,

On your IDE, you can “refresh” (right click menu) the database columns in the Database sheet.

On my PhpStorm 2023.2.4, this advice allowed me to recover the "Set to null" menu in the right click.

 

0

Please sign in to leave a comment.