Re: BUG #8681: column 'n_tup_del' of pg_stat_user_tables doesn't change in case of truncate - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #8681: column 'n_tup_del' of pg_stat_user_tables doesn't change in case of truncate
Date
Msg-id 25088.1386956692@sss.pgh.pa.us
Whole thread Raw
In response to BUG #8681: column 'n_tup_del' of pg_stat_user_tables doesn't change in case of truncate  (anitchakkarwar@gmail.com)
Responses Re: BUG #8681: column 'n_tup_del' of pg_stat_user_tables doesn't change in case of truncate  (Anit Chakkarwar <anitchakkarwar@gmail.com>)
List pgsql-bugs
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

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #8679: Error in regex function
Next
From: david fleischhauer
Date:
Subject: permission issues with PostgreSQL 9.2 EnterpriseDB one-click installer on windows 7 causes initcluster to fail