Gallivan was elected Sheriff of Erie County in 1998 and served through 2005. Prior to being elected Sheriff, Patrick Gallivan served 15 years in the
New York State Police, rising through the ranks from
Trooper to
Captain. Between his time as Sheriff and as a New York State Senator, Gallivan served as a commissioner on the
state parole board. After the retirement of incumbent senator
Dale Volker, Gallivan defeated former Erie County Republican Party chairman James Domagalski and
David DiPietro in a three-way Republican primary in September 2010, going on to defeat Democrat Cynthia Appleton and DiPietro (who continued to run on a line labeled "
Tea") in the general election in November of the same year. In 2011, Gallivan voted against allowing same-sex marriage in New York during the senate roll-call vote on the
Marriage Equality Act, which legally recognized same-sex marriages performed in the state, in a closely divided Senate vote of 33-29. ==Personal==