On Sun, Apr 4, 2021 at 8:14 AM Zhihong Yu <z...@yugabyte.com> wrote: > > Hi, > I was looking at AttrDefaultFetch and saw that the variable found is never > read. > > I think it can be removed. See attached patch.
+1 to remove it and the patch LGTM. For reference, below is the commit that removed last usage of "found" variable: commit 16828d5c0273b4fe5f10f42588005f16b415b2d8 Author: Andrew Dunstan <and...@dunslane.net> Date: Wed Mar 28 10:43:52 2018 +1030 Fast ALTER TABLE ADD COLUMN with a non-NULL default Currently adding a column to a table with a non-NULL default results in a rewrite of the table. For large tables this can be both expensive and disruptive. This patch removes the need for the rewrite as long as the @@ -4063,10 +4125,6 @@ AttrDefaultFetch(Relation relation) systable_endscan(adscan); heap_close(adrel, AccessShareLock); - - if (found != ndef) - elog(WARNING, "%d attrdef record(s) missing for rel %s", - ndef - found, RelationGetRelationName(relation)); } With Regards, Bharath Rupireddy. EnterpriseDB: http://www.enterprisedb.com