Re: using xmin in a query?

Поиск
Список
Период
Сортировка
От Michael Nolan
Тема Re: using xmin in a query?
Дата
Msg-id CAOzAqu+cbc-hx7gEAEeTafzx46rOXHX0aFvrqxvXdoLThXp51g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: using xmin in a query?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: using xmin in a query?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general


On Thu, Jul 28, 2011 at 2:27 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Michael Nolan <htfoot@gmail.com> 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

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: using xmin in a query?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: using xmin in a query?