changed from sql to pg