I have a nodejs application that is used to insert values into my Postgres DB. The payload i send contains values that are a mix of string , number and json. I have a script that inserts a record which has two columns A (string) and column B (json) every 10 min. Insertion takes place successfully. However after few hours the sequealize function inserts values only of column A and skips column B. Then in the script if i pass payload with different columns (string or number) they get inserted but json columns dont get inserted. SO then i restart my application and run the script, insertion into DB takes place successfully .
"msg":"The payload is :{n "userId": "user-1726164444155",n "user": "abc",n "customdata": {n "test": 10,n "profileComplete": "0.00"n },n "id": "x1623836053988_user-1726164444155"n}"}
Executing (default): INSERT INTO “Users” (“id”,”userid”,”user”,”createdat”,”updatedat”) VALUES ($1,$2,$3,$4,$5) RETURNING
it skips insertion of customdata ^.
INSERT INTO "Users" ("id","userid","user","customdata","createdat","updatedat") VALUES ($1,$2,$3,$4,$5,$6) RETURNING
however when i restart the application , insertion of customdata takes place successfully . Here customdata is of json type.
Whenever i restart the application, insertion of json column takes place successfully. Not sure what is the link between restarting an application and records insertion. This may not be an issue with postgres DB since i can directly insert records of json type there.
Strangely Sequelize doesnt throw any error.
Current version used : “sequelize”: “6.15.0”
If you see this question, do you understand what the question is asking? Why not just paste the simplest code
1