Fixed compatibility with postgres