A polymer containing at least one repeating unit of formula and at least one repeating unit of formula and optionally further repeating units, where G1 and G2, independently of one another, denote a structural unit which contributes to the polymer backbone, G 1 has the formula -(C=O)-Z-(C=O)-NR'-CH 2 CH 2 -(N-functional group)-CH 2 CH 2 -NR'-*, where each R' independently represents H or C 1 -C 4 alkyl, Z represents a C 2 -C 8 alkanediyl group, preferably ethane-1,2-diyl, and "functional group" represents the dihydroxyphenyl functional group according to formula that is bonded via A/A1, G 2 has the formula *-(C=O)-Z'-(C=O)-NR'-CH 2 CH 2 -(N-functional group)-CH 2 CH 2 -NR'-*, where each R' independently represents H or C 1 -C 4 alkyl, Z represents a C 2 -C 8 alkanediyl group, preferably ethane-1,2-diyl, and "functional group" represents -A 4 -A 3 -X, A and A 4, independently of one another, denote a spacer group of a side chain of the polymer or a direct bond, A 1 denotes a linking group of the catechol functional group from formula to the spacer group A or a direct bond, A 3 denotes a linking group of the group X to the spacer group A 4 or a direct bond, R 2 and R 3, independently of one another, represent a hydrogen atom, a C 1 -C 4 alkyl group, a C 2 -C 4 hydroxyalkyl group, a C 1 -C 4 alkoxy group, a halogen atom, a sulfonic acid group, a C 1 -C 10 alkylcarbonyloxy group, a C 1 -C 10 alkoxycarbonyl group, a C 6 -C 10 aryloxycarbonyl group, a C 6 -C 10 arylcarbonyloxy group, C 2 -C 10 alkenylcarbonyloxy group, a C 2 -C 10 alkenyloxycarbonyl group, a hydroxyl group, an amino group, an ammonium group, X represents an amino group -N(R 5)(R 6) or an ammonio group - N + (R 5)(R 6)(R 7) 1/n An"-, where R 5, R 6 and R 7 each, independently of one another, represent a hydrogen atom, a C 1 -C 4 alkyl group or a C 2 -C 4 hydroxyalkyl group and 1/n An n -represents an equivalent of an n-valent anion, preferably with n = 1, with the proviso that the repeating units of formula are different from the repeating units of formula and the molar ratio of the units of formula to the units of formula is in the range of from 0.5 to 1 to 4 to 1, preferably 1 to 1 to 2 to 1. where G1 and G2, independently of one another, denote a structural unit which contributes to the polymer backbone, G 1 has the formula -(C=O)-Z-(C=O)-NR'-CH 2 CH 2 -(N-functional group)-CH 2 CH 2 -NR'-*, where each R' independently represents H or C 1 -C 4 alkyl, Z represents a C 2 -C 8 alkanediyl group, preferably ethane-1,2-diyl, and "functional group" represents the dihydroxyphenyl functional group according to formula that is bonded via A/A1, G 2 has the formula *-(C=O)-Z'-(C=O)-NR'-CH 2 CH 2 -(N-functional group)-CH 2 CH 2 -NR'-*, where each R' independently represents H or C 1 -C 4 alkyl, Z represents a C 2 -C 8 alkanediyl group, preferably ethane-1,2-diyl, and "functional group" represents -A 4 -A 3 -X, A and A 4, independently of one another, denote a spacer group of a side chain of the polymer or a direct bond, A 1 denotes a linking group of the catechol functional group from formula to the spacer group A or a direct bond, A 3 denotes a linking group of the group X to the spacer group A 4 or a direct bond, R 2 and R 3, independently of one another, represent a hydrogen atom, a C 1 -C 4 alkyl group, a C 2 -C 4 hydroxyalkyl group, a C 1 -C 4 alkoxy group, a halogen atom, a sulfonic acid group, a C 1 -C 10 alkylcarbonyloxy group, a C 1 -C 10 alkoxycarbonyl group, a C 6 -C 10 aryloxycarbonyl group, a C 6 -C 10 arylcarbonyloxy group, C 2 -C 10 alkenylcarbonyloxy group, a C 2 -C 10 alkenyloxycarbonyl group, a hydroxyl group, an amino group, an ammonium group, X represents an amino group -N(R 5)(R 6) or an ammonio group - N + (R 5)(R 6)(R 7) 1/n An"-, where R 5, R 6 and R 7 each, independently of one another, represent a hydrogen atom, a C 1 -C 4 alkyl group or a C 2 -C 4 hydroxyalkyl group and 1/n An n -represents an equivalent of an n-valent anion, preferably with n = 1, with the proviso that the repeating units of formula are different from the repeating units of formula and the molar ratio of the units of formula to the units of formula is in the range of from 0.5 to 1 to 4 to 1, preferably 1 to 1 to 2 to 1.