A number of people have suggested that there should be an int4(bool)conversion function, but no one's got round to actually writing it.
Presumably the behavior ought to be false => 0 true => 1 NULL => NULL
regards, tom lane