0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

postagerSQL 間違い探しLv.1

Posted at

sample_tableというテーブルのsampleカラム(jsonb型)の値に、nameというstring型のプロパティを追加します。

間違い.ts
 UPDATE sample_table SET option = jsonb_set(sample, '{name}', 'タロウ') WHERE id = 1

正しい.ts
 UPDATE sample_table SET option = jsonb_set(sample, '{name}', '"タロウ"') WHERE id = 1

答えはstring型なのでタロウをダブルクォーテーションで囲む部分でした。
恥ずかしいことにちょっとハマりました🙄

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?