The PG wire protocol specification [1] defines these fields thus:
If the field can be identified as a column of a specific table, the object ID of the table; otherwise zero.
If the field can be identified as a column of a specific table, the attribute number of the column; otherwise zero.
My reading of that is that we should populate these fields only for the case of direct selection from a table.
s/can be identified as/is/g ?
Experience shows people are inferring a lot from "can be identified" so we should remove it. "is" maybe over-simplifies a bit but in the correct direction.