Why does array_position_common bitwise NOT an Oid type?

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Subject: Why does array_position_common bitwise NOT an Oid type?
Date: 2017-12-17 01:48:38
Message-ID: CAKJS1f9e8oYEMwX8CjT8oQmmXLamGLD95Ty7Frda8v_hh6_W5A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

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?

--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-12-17 01:53:44 Re: Why does array_position_common bitwise NOT an Oid type?
Previous Message Tom Lane 2017-12-17 01:48:32 Re: pgsql: Provide overflow safe integer math inline functions.