Adjust scripts for postgresql 9.3