Public chaining of criminals on the old west

Watching the Audie Murphy movie “Showdown.” Prisoners are chained to a tall post with neck shackles in the town square. Was this ever a thing?

I wouldn’t be surprised if they were repurposed after the abolition of slavery in the 1860s.

If it was a recently-established town, they might not have gotten around to building a jail yet. Or the jail might be filled to capacity.

This was covered in Support Your Local Sheriff.