Questions tagged «postgresql-9.4»

9
如何在Postgres 9.4中对JSONB类型的列执行更新操作
查看Postgres 9.4数据类型JSONB的文档,对我来说,如何立即对JSONB列进行更新并不是很明显。 JSONB类型和功能的文档: http://www.postgresql.org/docs/9.4/static/functions-json.html http://www.postgresql.org/docs/9.4/static/datatype-json.html 作为示例,我具有以下基本表结构: CREATE TABLE test(id serial, data jsonb); 插入很容易,如: INSERT INTO test(data) values ('{"name": "my-name", "tags": ["tag1", "tag2"]}'); 现在,我将如何更新“数据”列?这是无效的语法: UPDATE test SET data->'name' = 'my-other-name' WHERE id = 1; 这是我错过的明显地方吗?谢谢。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.