Search Postgresql Archives

Re: not(t_xmax = 0)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



this function didn't work to know if a row can surely dead?

http://doxygen.postgresql.org/tqual_8c_source.html#l01236


De: Tom Lane <tgl@xxxxxxxxxxxxx>
Para: Kevin Grittner <kgrittn@xxxxxxxx>
CC: Alejandro Carrillo <fasterzip@xxxxxxxx>; pgsql-general@xxxxxxxxxxxxxx
Enviado: Domingo 20 de enero de 2013 15:30
Asunto: Re: not(t_xmax = 0)

"Kevin Grittner" <kgrittn@xxxxxxxx> writes:
> Alejandro Carrillo wrote:
>> I try to do a function that let know which rows are deleted in a
>> table using the xmax !=0

> That's not something you're going to have much luck with by using
> plpgsql to try to parse heap pages.

No, because xmax being nonzero doesn't prove much: the row might be
updated/deleted, or it might only have been locked by SELECT FOR UPDATE,
or it might be perfectly fine because the updating transaction rolled
back.  You could get a limited amount of information by checking the
hint bits in t_infomask, but if the hint bits aren't set you won't know
what the row's state is.

You'd really need to do this in C using the tqual.c functions for the
results to be trustworthy.

I'm a bit surprised that contrib/pageinspect doesn't have a mechanism
for pulling out only committed-good heap tuples...

            regards, tom lane



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux