For simplicity sake, say I have a table with a single column that is just an hstore. What is the most efficient way to go about getting a unqiue list of all the keys from all rows of the hstore?
eg.
my_hstore
------------
a=>1,b=>2
b=>2,c=>3
x=>10,y=>11
y=>11,z=12
What is the most efficient way to retrieve a list/array/set containing (a,b,c,x,y,z) ?
There’s always the straight forward
skeysapproach:And if you need an array, then add an
array_agg: