Artacus <[EMAIL PROTECTED]> writes:
>> This will not work, or at least it will stop working after your
>> installation passes 4 billion transactions.

>     * So what exactly happens at the 4 billion mark?

txid keeps going (that's why it's a bigint).  xid will wrap around.

>     * Why can't I cast an xid to int or bigint?

No very strong reason except that no such code is provided...
but you do have to think hard about the fact that xid comparison
is circular and does not work at all like integer comparison.

>     * The table in question is the largest in the db. How performative
>       is it to query based on xmin? Is xmin indexed? Can it be?

Not very, no, and no.

If you were really desperate you could make an indexed bigint column
that was filled with current_txid by an insert/update trigger, and
then search on that.

                        regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to