Adding a key to an empty hstore column

后端 未结 4 1005
礼貌的吻别
礼貌的吻别 2021-02-02 13:30

According to the postgres documentation, you add a key to an hstore column as follows:

UPDATE tab SET h = h || (\'c\' => \'3\');

But it seem

4条回答
  •  执念已碎
    2021-02-02 13:56

    how about:

    UPDATE htest SET h = COALESCE(h, '') || ('foo'=>'bar') WHERE t='key';
    

提交回复
热议问题