3

I've started working with rails 4.1.5 and postgresql 9.3.5, so my question is how to use update_all with hstore in postgress in this situation(if that's even possible): "1" => [1, 2, 3] so if "1" exists, add number to array, else create new hstore entry.

This is what I've been trying, but it doesn't work.

Account.update_all("column = hstore('1', array_append(avals(slice(column, '1')), '2'))")
BenMorel
  • 34,448
  • 50
  • 182
  • 322
GuskiS
  • 41
  • 1
  • 3

0 Answers0