Search Postgresql Archives

using xmin in a query?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux