Thread: pgsql: Remove the pgstat_drop_relation() call from

pgsql: Remove the pgstat_drop_relation() call from

From
tgl@postgresql.org (Tom Lane)
Date:
Log Message:
-----------
Remove the pgstat_drop_relation() call from smgr_internal_unlink(), because
we don't know at that point which relation OID to tell pgstat to forget.
The code was passing the relfilenode, which is incorrect, and could possibly
cause some other relation's stats to be zeroed out.  While we could try to
clean this up, it seems much simpler and more reliable to let the next
invocation of pgstat_vacuum_tabstat() fix things; which indeed is how it
worked before I introduced the buggy code into 8.1.3 and later :-(.
Problem noticed by Itagaki Takahiro, fix is per subsequent discussion.

Tags:
----
REL8_2_STABLE

Modified Files:
--------------
    pgsql/src/backend/postmaster:
        pgstat.c (r1.140.2.4 -> r1.140.2.5)

(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/postmaster/pgstat.c.diff?r1=1.140.2.4&r2=1.140.2.5)
    pgsql/src/backend/storage/smgr:
        smgr.c (r1.101 -> r1.101.2.1)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/smgr/smgr.c.diff?r1=1.101&r2=1.101.2.1)
    pgsql/src/include:
        pgstat.h (r1.50 -> r1.50.2.1)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/pgstat.h.diff?r1=1.50&r2=1.50.2.1)