Solve bug with postgres < 9.3 + replace { with (