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.
begin:vcard fn:Ericson Smith n:Smith;Ericson org:Did-it.com;Programming adr:#304;;55 Maple Avenue;Rockville Center;NY;11570;USA email;internet:eric@did-it.com title:Web Developer tel;work:516-255-0500 tel;cell:646-483-3420 note:Nothing special! x-mozilla-html:FALSE url:http://www.did-it.com version:2.1 end:vcard
---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match