Re: Unused variable found in AttrDefaultFetch

Поиск
Список
Период
Сортировка
От Bharath Rupireddy
Тема Re: Unused variable found in AttrDefaultFetch
Дата
Msg-id CALj2ACXNBkOWPbhMu4MF9kiBORNoRmo2YvzSURD50uSRXuwPug@mail.gmail.com
обсуждение исходный текст
Ответ на Unused variable found in AttrDefaultFetch  (Zhihong Yu <zyu@yugabyte.com>)
Ответы Re: Unused variable found in AttrDefaultFetch
Список pgsql-hackers
On Sun, Apr 4, 2021 at 8:14 AM Zhihong Yu <zyu@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 <andrew@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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bharath Rupireddy
Дата:
Сообщение: Re: TRUNCATE on foreign table
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Unused variable found in AttrDefaultFetch