Re: Why does array_position_common bitwise NOT an Oid type?

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Subject: Re: Why does array_position_common bitwise NOT an Oid type?
Date: 2017-12-17 14:56:40
Message-ID: CAKJS1f8xyUNR3mbSMGZ8kBLUF9q6e_3vP6-6a+AmWVmmKhh=sQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 17 December 2017 at 14:53, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> David Rowley <david(dot)rowley(at)2ndquadrant(dot)com> writes:
>> I was puzzled to see the following code:
>
>> my_extra->element_type = ~element_type;
>
> 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.

That makes sense. I'd just have expected more documentation on that.
Although, perhaps I just didn't look hard enough. I did fail to notice
the fact that the same thing does occur over and over when I sent this
originally.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2017-12-17 15:46:56 Re: PostgreSQL crashes with SIGSEGV
Previous Message David Rowley 2017-12-17 14:54:14 Re: pg_(total_)relation_size and partitioned tables