Fixed for pgsql