using xmin in a query?

Поиск
Список
Период
Сортировка
От Michael Nolan
Тема using xmin in a query?
Дата
Msg-id CAOzAquJ9oiqLx9iw50V_jUOMw1tt1YT06wPSSnhEdJ5mAt5LEQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: using xmin in a query?  (Andy Colson <andy@squeakycode.net>)
Re: using xmin in a query?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
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@tssi.com

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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: eval function
Следующее
От: "Maton, Brett"
Дата:
Сообщение: Fresh Restore - relation contains more than "max_fsm_pages"