updated for postgresql version 9.3.5