converted to postgres from sqlLite