Re: Remove redundant initialization of smgr pointer for relcache

From: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
To: Jingtang Zhang <mrdrivingduck(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Remove redundant initialization of smgr pointer for relcache
Date: 2026-01-23 08:08:47
Message-ID: CAN4CZFP4zaFWXx2cP=X=6+VoDnoJ8Dh9cTpT4SjGdAAp=Ui2AQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello!

This is a simple change, and should work correctly.

However, I think I would do more, as this part of the code is just confusing.

* AllocateRelationDesc only has one caller
* Its description comment only mentions some things it does, not all
of them. The call site explains it differently, but also not
completely.

I would at least also modify the comments so that they are only at one
place and explain the function correctly. But maybe it would be even
better to remove this function completely or to modify it so it's
usable at multiple places?

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2026-01-23 08:20:29 Re: warning: dereferencing type-punned pointer
Previous Message Antonin Houska 2026-01-23 08:02:12 Re: Race conditions in logical decoding