David Rowley <david.row...@2ndquadrant.com> writes:
> I was puzzled to see the following code:

> my_extra->element_type = ~element_type;

> It looks quite wrong, but if its right then I think it needs a comment
> to explain it. I don't see any in the area which mentions it. My best
> guess would be that it's using this to know if the type data has been
> cached, but then why would it not use InvalidOid for that?

If memory serves, the idea was to force the subsequent datatype-lookup
path to be taken, even if for some reason element_type is InvalidOid.
If we take the lookup path then the bogus element_type will be detected
and reported; if we don't, it won't be.

We could instead add an explicit test for element_type == InvalidOid,
but that's just more duplicative code.

                        regards, tom lane

Reply via email to