Re: XID Data Types - Mailing list pgsql-general

From Ericson Smith
Subject Re: XID Data Types
Date
Msg-id 4096BA47.7060407@did-it.com
Whole thread Raw
In response to Re: XID Data Types  (Manfred Koizar <mkoi-pg@aon.at>)
List pgsql-general
I've been reading about the CREATE OPERATOR command.

Apparently there is an operator to test equality between an xmin type
and an integer type, how do it go about creating another type to make a
 > or < comparison ?

The documents are pretty straightforward about creating other types, but
I was not able to find much information about the xid type. In pg_proc,
I found that there are the following comparators:

xideqint4
xideq

Which would make a equal comparison between an xid = int4, or xid=xid.
This seems to work ok. My goal is to find a decent way of syncing
records with an external cache. The xmin field that exists within every
table is updated whenever a transaction is successful on record(s). I
have a process that will run, and look at the last xmin value (I stored
in another table), and grab records that have an xmin greater than  the
last stored value. We think that this is a better way to sync data than
the old way of using triggers that updated a sync table on inserts and
deletes. Only certain tables need to be sync'd with our external caches.

Any suggestions if this is the right way to go, or is there another way
that this particular problem could be solved?

Any suggestions would be really appreciated.

Regards
- Ericson Smith


Manfred Koizar wrote:

>On Mon, 03 May 2004 13:38:45 -0400, Ericson Smith <eric@did-it.com>
>wrote:
>
>
>>didit=# select *,xmin from settings where xmin > '187167023'::xid limit 5;
>>ERROR:  operator does not exist: xid > xid
>>
>>
>
>There might be better solutions, but when I ran into the same problem,
>the age(xid) function helped at lot.
>
>
>
>

Attachment

pgsql-general by date:

Previous
From: "A Palmblad"
Date:
Subject: C Functions, datatypes
Next
From: Manfred Koizar
Date:
Subject: Re: 7.4.2 Regression tests: test stats loops indefinately...