make it compatible with the latest pgsql