Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

No dynamic SQL necessary.

jsonb_populate_record(…) was made precisely for this kind of scenario. Combine with an INSERT…ON CONFLICT DO UPDATE statement and Bob's your uncle.

https://www.postgresql.org/docs/current/functions-json.html



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: