I took out the precat o2 sensor which had a male electrical harness. I went to my local autoparts store and apparently the only o2 sensors that have male harnesses (in their stores) are downstream sensors. I just wasn't sure if that means anything or if that is just what they had in stock. I figured since it was a precat that it was an upstream but I may be wrong.
Both pre-cat and after-cat sensors having the same connector type is consistent with what GaryDoug said the dealer listings show. Don't get hung up on the "upstream" and "downstream" designation. Get the part indicated by the GM dealer parts listing, with a connector that will match the wiring harness.
The code you got is for the heater element in the circuit. The PCM watches how long after a cold startup it takes for the sensor to heat up to the point where it starts to work. That problem can be caused either by a faulty heater element in the sensor, or by the harness wiring that supplies 12V to the sensor.
Try swapping the two sensors at the cat. See if the problem follows the sensor (sensor problem) or stays in the pre-cat location (wiring problem).