Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VrWnK-00055z-Sa for pgsql-bugs@arkaria.postgresql.org; Fri, 13 Dec 2013 17:44:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VrWnK-0002P4-CX for pgsql-bugs@arkaria.postgresql.org; Fri, 13 Dec 2013 17:44:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VrWnJ-0002Oy-Np for pgsql-bugs@postgresql.org; Fri, 13 Dec 2013 17:44:57 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VrWnH-0008RD-J8 for pgsql-bugs@postgresql.org; Fri, 13 Dec 2013 17:44:57 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id rBDHiqtf025089; Fri, 13 Dec 2013 12:44:52 -0500 From: Tom Lane To: anitchakkarwar@gmail.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #8681: column 'n_tup_del' of pg_stat_user_tables doesn't change in case of truncate In-reply-to: References: Comments: In-reply-to anitchakkarwar@gmail.com message dated "Fri, 13 Dec 2013 13:13:51 +0000" Date: Fri, 13 Dec 2013 12:44:52 -0500 Message-ID: <25088.1386956692@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org anitchakkarwar@gmail.com writes: > If I do truncate then n_tup_del value is 0 but all the rows are deleted from > table. > Is this something expected behaviour ? Yes. We're certainly not going to make TRUNCATE update that count, since that would require making a pass over the table to count the to-be-deleted tuples, and the whole point of TRUNCATE is to not make a pass over the table. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs