Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Streamlining user types in Qlik Cloud capacity-based subscriptions: Read the Details
cancel
Showing results for 
Search instead for 
Did you mean: 
ilmp
Contributor
Contributor

[resolved] insert into postgres table only some columns

fails with "null value in column "column_name" violates not-null constraint"
Hello,
I want to insert two values in a postgre table with more than two columns.
The primary key has a sequence. So will be filled automaticly.
If I try. I get the error message above.
What ist the correct approach for this task?
Thank you for your help!
Christian
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hello
Is there one column called "column_name" and it is defined not null in your table?
Best regards
Shong

View solution in original post

2 Replies
Anonymous
Not applicable

Hello
Is there one column called "column_name" and it is defined not null in your table?
Best regards
Shong
ilmp
Contributor
Contributor
Author

Hello Shong,
you brought me on the right path. Thank you very much!
It was not an error of my job. It was an error of my Postgres DB.
The column name "column_name" was so strange that I was not sensitiv enough.
ALTER TABLE <table_name> ALTER COLUMN column_name DROP NOT NULL;
ALTER SEQUENCE <sequence_name> restart with 251;
Best regards,
Christian