My building started to throw PG::NotNullViolation from nothing

rails
postgresql

#1

Hi all.

My building started to throw “PG::NotNullViolation: ERROR: null value in column “id” violates not-null constraint” weirdly. It works locally. It seems some problem while generating the serial key.

I would appreciate any help.

Thanks.


#2

Obviously, readers would need at least a config file, if not also code, to be able to start to help. I don’t know Rails, but this sounds like Postgres is trying to insert a row where (a) a value has not been provided for a column, and (b) that column has a not-null constraint.

Would you show us the query you are running, and the CREATE TABLE for the table you’re inserting into?


#3