PostgreSQL - Inserting via console view
I'm not sure if this is a change in DataGrip but I'm almost 100% certain that this didn't happen before.
I double-click on a table and add some data:

The first column is ID and it's NULL, it's defined as IDENTITY.
When I press CTRL+ENTER, I'm getting this error:

It makes sense, of course, but ID should be auto-generated, shouldn't they?
Please sign in to leave a comment.
Are you saying that the identity id column should have been shown with a generated value in the error message despite the constraint restriction? Just trying to understand your point.
No, that leaving it NULL shouldn't be a problem to insert the data. I do it with MySQL all the time. Maybe Postgres query shouldn't contain identity columns in this case?
In MySQL, we see the word <generated>
And that's why I can add it. Somehow in Postgres, adding data through console becomes useless because we have to enter the Identities manually but then you also have to reset the pointer.
I think this could be postgres behaviour, which means when Datagrip creates a query, unless identities are explicitly given, it could omit them from the query.
What is your current DataGrip version? I tested the value input of table values with an identity column in data editor, and they are generated automatically. Please also provide the table definition so we can investigate
And is that postgres?
Here's the DDL of the table:
I am on 2025.1, I've been having weird problems with updating it lately (DG freezing out of nowehere itp.) When I go to “Update and Restart”, I get this:
But it won't start again and I usually have to restart the laptop and then 2025.1 is back and I can turn the program on, so for now I'm staying on 2025.1
This was solely tested on a PG data source. I tested your definition, and the conflict is caused by contract_id, which by definition, is NOT NULL. The identity generated via a sequence assigns a value in the way it should. You need to specify a non-null value in this column to insert a row. Not seeing any issues here
As for the performance issue, please report on our tracker:
https://youtrack.jetbrains.com/newIssue?project=DBE
How can you have a null on primary key column?
Contract_id is never null when I add it. Have a look at the screenshot of my first post. THe first non-null number is contract_id
https://www.postgresql.org/docs/current/ddl-identity-columns.html
Please also specify your current jdbc driver version, postgres version, and IDE build version in Help - About