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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: minimal update



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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group