Re: XID Data Types

Поиск
Список
Период
Сортировка
От Ericson Smith
Тема Re: XID Data Types
Дата
Msg-id 4096BA47.7060407@did-it.com
обсуждение исходный текст
Ответ на Re: XID Data Types  (Manfred Koizar <mkoi-pg@aon.at>)
Список 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.
>
>
>
>

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: "A Palmblad"
Дата:
Сообщение: C Functions, datatypes
Следующее
От: Manfred Koizar
Дата:
Сообщение: Re: 7.4.2 Regression tests: test stats loops indefinately...