0
我正在使用postgresql 9.6。 我建立一個函數在那裏我做了一個「選擇素」 T這樣的:Postgresql函數plpython選擇json值
id = TD["new"]["id"]
qry = plpy.prepare ("SELECT (decode->>'key')::integer AS key FROM table where id = $1;", ["int"])
res= plpy.execute(qry,[id])
請求做工精細,但結果保持鍵和值,不僅看重。 實際上,結果是這樣的:{「key」:2937}
我只想要這個值。