Re: XID Data Types

From: Ericson Smith <eric(at)did-it(dot)com>
To:
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: XID Data Types
Date: 2004-05-03 21:31:51
Message-ID: 4096BA47.7060407@did-it.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)did-it(dot)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 Content-Type Size
eric.vcf text/x-vcard 315 bytes

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Manfred Koizar 2004-05-03 21:54:54 Re: 7.4.2 Regression tests: test stats loops indefinately...
Previous Message A Palmblad 2004-05-03 19:48:19 C Functions, datatypes