Updating findcommonname Postgres function and changing file name to have sql extension