In everyday speech, the terms "jail"jail and "prison"prison are used interchangeably in many situations. However, my understanding is that, at least in the US, they actually refer to slightly different things. For instance, it appears to me that it would be rather unusual for an American to use the expression "federal jail"federal jail. He'd most probably say "federal prison"federal prison instead.
Am I right? What is the correct usage of "jail"jail vs "prison"prison? Are there any (historical or legal) differences between the US and the Commonwealth?