Re: Property graph: fix error handling when dropping non-existent label property

Álvaro Herrera <alvherre@kurilemu.de>

From: Álvaro Herrera <alvherre@kurilemu.de>
To: "Chao Li" <li.evan.chao@gmail.com>, "Ashutosh Bapat" <ashutosh.bapat.oss@gmail.com>
Cc: "L. pgsql-hackers" <pgsql-hackers@lists.postgresql.org>
Date: 2026-04-29T09:51:55Z
Lists: pgsql-hackers
On 2026-04-29, Chao Li wrote:

>> Looks good to me. However, I did change OidIsValid() and !OidIsValid()
>> back to (oid) and (!oid) conditions to be consistent with the rest of
>> the code.
>
> In the file, I also see:
> ```
>     if (pgrelid == InvalidOid)
> ```
>
> Should we take this opportunity to change to use OidIsValid() 
> everywhere in the file? As this feature is new to PG19, we can cleanup 
> the inconsistency before releasing v19. Otherwise some people might 
> also file a cleanup patch for this in the future.

Yeah, I find "if (oid)" a rather terrible coding pattern. The negative one is perhaps not so bad, but I'd keep both cases similar by using the macro in both, for consistency.

-- 
Álvaro Herrera



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix handling of dropping a property not associated with the given label