You'd actually need to get a pid *reuse* during that short time.
That isn't so implausible on a system which assigns PIDs randomly. Holding the SInvalLock doesn't remove the race condition, but it makes it less likely to occur for essentially very little cost.
Bottom line - while maybe slightly more correcet, not sure it's necessary.
IMHO it's worth doing.
-Neil
---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faqs/FAQ.html
