Given a global field K and a positive integer n, we present a diophantine criterion for a polynomial in one variable of degree n over K not to have any root in K. This strengthens the known result that the set of non-n-th-powers in K is diophantine when K is a number field. We also deduce a diophantine criterion for a polynomial over K of given degree in a given number of variables to be irreducible. Our approach is based on a generalisation of the quaternion method used by Poonen and Koenigsmann for first-order definitions of Z in Q.