rand() to random() conversion for pgsql