Re: BUG #17877: Referencing a system column in a foreign key leads to incorrect memory access

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: ranier(dot)vf(at)gmail(dot)com
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-hackers(at)postgresql(dot)org, alvherre(at)alvh(dot)no-ip(dot)org
Subject: Re: BUG #17877: Referencing a system column in a foreign key leads to incorrect memory access
Date: 2023-04-03 06:31:55
Message-ID: 20230403.153155.218653847693637378.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Sat, 1 Apr 2023 10:56:08 -0300, Ranier Vilela <ranier(dot)vf(at)gmail(dot)com> wrote in
> IMO should be:
> * System attributes have attribute numbers less or equal to 0 that are
> * unique
> * within the class, but not constrained to any particular range.

Attnum == 0 is invalid and doesn't belong to either user columns or
system columns. You're actually right that it's in limbo, but I
believe the change you suggested actually makes the correct comment
incorrect. In the condition you're asking about, I don't think we
really need to worry about an impossible case. If I wanted to pay more
attenstion to it, I would use an assertion, but I don't think it's
necessary here.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2023-04-03 06:35:17 Re: Minimal logical decoding on standbys
Previous Message Drouvot, Bertrand 2023-04-03 06:10:22 Re: Minimal logical decoding on standbys