Skip site navigation (1) Skip section navigation (2)

Re: minimal update

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: minimal update
Date: 2007-12-28 23:24:54
Message-ID: 18370.1198884294@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> How does this look?

>     if (newtuple->t_len == oldtuple->t_len &&
>         newtuple->t_data->t_hoff == oldtuple->t_data->t_hoff &&
>         HeapTupleHeaderGetNatts(newtuple) == HeapTupleHeaderGetNatts(oldtuple) &&
>         (newtuple->t_data->t_infomask & (HEAP_HASOID|HEAP_HASNULL)) == (oldtuple->t_data->t_infomask & (HEAP_HASOID|HEAP_HASNULL)) &&
>         memcmp(newtuple->t_data + offsetof(HeapTupleHeaderData, t_bits),
>                oldtuple->t_data + offsetof(HeapTupleHeaderData, t_bits)
>                newtuple->t_len - offsetof(HeapTupleHeaderData, t_bits)) == 0)

>       rettuple = NULL;

Looks sane.  It might be even saner if you compare all of the
non-visibility-related infomask bits, viz

	(newtuple->t_data->t_infomask & ~HEAP_XACT_MASK) ==
	(oldtuple->t_data->t_infomask & ~HEAP_XACT_MASK)

rather than just HASOID and HASNULL.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Simon RiggsDate: 2007-12-29 00:04:44
Subject: Re: Archiver behavior at shutdown
Previous:From: Andrew DunstanDate: 2007-12-28 22:56:56
Subject: Re: minimal update

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group