fix for pgsql bug