Why does this query succeed:
select count(*) from tablename where xmin = 2
while this query fails:
select count(*) from tablename where xmin != 2
The latter will generate an error message (using 9.0.4, but it does not seem to be version specific):
ERROR: operator does not exist: xid <> integer
LINE 1: select count(*) from tablename where xmin != 2;
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
What cast or comparison operator would work? You cannot cast an xid to an integer, nor can you cast an integer to an xid.
The only way I can get this to work is:
select count(*) from tablename where not xmin = 2
That seems pretty obscure.
--
Mike Nolan
nolan@xxxxxxxx