swapped sql3 for pg