It's hard to tell from the pictures, but my guess would be on a
species of some sort. There are literally a dozen different species that are pretty much looking exactly the same on a not-so-close examination. Even looking very closely at the fish, it would be hard to tell different species apart without some understanding of where it was captured. [This also makes it almost impossible to tell what species it is if the species was captive bred, which may be a possibility].
It is possible that it's a more common
species, but that is my second guess. It's pretty easy to tell them apart, as the
Pterygoplichthys has more rays (10-12 vs

in the dorsal (back) fin, so a close-up of the dorsal fin (in raised position) would be a good way to get a clear ID at least to genus level.
If it's attacking your goldfish, it's probablu suffering from malnutrition - feed it with courgette(zucchini) and algae-wafers.
--
Mats