made changes to change from mysql to postgres