Re: Using xmin to identify last modified rows

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: Using xmin to identify last modified rows
Дата
Msg-id 871vtmveif.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Using xmin to identify last modified rows  ("Stéphane A. Schildknecht"<stephane.schildknecht@postgresqlfr.org>)
Ответы Re: Using xmin to identify last modified rows  (Richard Broersma <richard.broersma@gmail.com>)
Re: Using xmin to identify last modified rows  ("Stéphane A. Schildknecht"<stephane.schildknecht@postgresqlfr.org>)
Список pgsql-general
"Stéphane A. Schildknecht" <stephane.schildknecht@postgresqlfr.org> writes:

> But, trying the same query on a non slonified DB, I got an error, as there is
> no ordering operator for xid.
>
> I think that in the slon case, the query uses the implicit cast xid->xxid, and
> then the operator to sort xxid.

You could order by age(xmin) instead

> What would be the best way to get last modified rows?

I'm not sure using xmin is such a great idea really. It's handy for ad-hoc
queries but there are all kinds of cases where it might not give you the
results you expect.

You probably want to put a timestamp column on your tables and manage the date
you put in their according to a policy you control.


--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's 24x7 Postgres support!

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

Предыдущее
От: Grzegorz Jaśkiewicz
Дата:
Сообщение: Re: funny view/temp table problem with query
Следующее
От: Richard Broersma
Дата:
Сообщение: Re: Using xmin to identify last modified rows