_覓 | 覦覈襦 | 豕蠏手 | 殊螳 | 譯殊碁 |
FrontPage › PostgreSQLJSON
|
|
[edit]
1 JSON 一危 #CREATE TABLE posts ( id serial NOT NULL, meta JSON ); レ valid? well-formed? json 伎伎 ル.
INSERT INTO posts (id, meta) VALUES ( 1, '{ "author": "outsider", "authorId": 43434, "sns": { "facebook": "https://facebook.com", "twitter": "https://twitter.com" }, "createAt": "2014-06-14", "category": ["pg", "tech", "dev"] }' ); [edit]
2 json vs jsonb #
[edit]
3 譟壱 #SELECT meta->'author' FROM posts; -- "outsider" SELECT meta->'sns'->'facebook' FROM posts; -- "https://facebook.com" SELECT meta->'sns'->>'facebook' FROM posts; -- https://facebook.com SELECT meta#>'{category, 2}' FROM posts; -- "dev"
鏤
|
蟲 覈詩 讌襷 蟲 讌 蟆 . 蠏碁 讌ろ 襴れ 覓伎螻朱 覦蠖 給. 讌 蟆語願 れ 蠍一. 覈詞朱 覿讌 蟆 讌朱 蟇伎ろる 企 蟆 螳誤 給. 螳 一渚 讌 朱 螳 襦 覈旧 覲 螻 襷 給. |