I have an array of even length, with comma delimited values (not necessarily homogeneous):
'{"a", 10000, "b", 20000}'
I would like to parse this postgres array into an hstore column, associating each odd entry (index 1,3,...) as a key, and each even entry (index 2,4,...) as value. Is this possible?
As Sami mentioned, just use:
SELECT hstore('{"a", 10000, "b", 20000}'::text[]);
Output:
hstore
----------------------------
"a"=>"10000", "b"=>"20000"
(1 row)