Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
postgres_sql [2018/07/13 04:18]
root [Clustering]
postgres_sql [2018/07/13 08:52] (current)
root [Using Views with Json]
Line 312: Line 312:
 </​code> ​ </​code> ​
  
 +== Update Row (Where json may be Null) == 
 +
 +<code sql>
 +UPDATE users
 +SET metadata = coalesce(metadata::​jsonb,'​{}'::​jsonb) || '​{"​test":​ true}'::​jsonb
 +WHERE id=...
 +RETURNING *;
 +</​code>​
 == Row to Json ==  == Row to Json == 
  
 
postgres_sql.txt · Last modified: 2018/07/13 08:52 by root
 
RSS - 200 © CrosswireDigitialMedia Ltd