Correction but not tested (only on postgresql 9.1+)