postgresql merge query
withupsertas(select 20 as user_id,'aaa' as hidden_columns, 50 as rows, 'bbb' as key, 'ccc' as default_columns),update_optionas(update config.users_info as u1 set hidden_columns = 'aaa',default_columns = 'ccc' from upsert where user_id = upsert.user_id and key = upsert.key)insert into config.users_info select upsert.user_id, upsert.hidden_columns, upsert.rows, upsert.key, upsert.default_columns f..