Search Postgresql Archives

Re: using xmin in a query?

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

 





On Thu, Jul 28, 2011 at 2:27 PM, Tom Lane <tgl@xxxxxxxxxxxxx> wrote:
Michael Nolan <htfoot@xxxxxxxxx> writes:
> Why does this query succeed:
> select count(*) from tablename where xmin = 2

> while this query fails:

> select count(*) from tablename where xmin != 2

It told you why not:

> ERROR:  operator does not exist: xid <> integer

You could do "where not (xmin = 2)", I suppose.

I understand that, Tom, and my original posted did cite 'not xmin = 2' as working. 

The parentheses appear to be optional, though in a more complex query they would probably be necessary to make sure it parses properly.

It appears to me that it is doing an implicit cast of the integer '2' into an xid in the first query.

It seems like we're being inconsistent here in allowing 'where xid = integer'
but not allowing 'where xid != integer'.

Is there no explicit 'cast to xid' available?
--
Mike Nolan

[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