... Oh, just to make things even more fun, PQsocket() returns int, not pgsocket; see its header comment. Therefore, that test is correctly coded as-is (though it's still useless), and the real problem is that ParallelSlot.sock ought to be declared int not pgsocket. If you look around at our other places that read PQsocket() and use its result in select() masks, they uniformly use int variables, and I think they're right.
Actually, the more I look at this code, the more problems I'm finding. The wait-for-a-free-connection code is just broken on its face, because it supposes it can retry select() waits without reinitializing the FD_SET. The loop in vacuum_one_database() uses "conn" to call prepare_vacuum_command() without any thought as to whether that is a free connection --- which, typically, it isn't. It looks to me like libpq silently copes with this silliness, just waiting for the active command to finish and then doing what it's told, but the net result is that supposedly-concurrent vacuums get serialized. regards, tom lane