Re: pg_relation_size / could not open relation with OID #

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg_relation_size / could not open relation with OID #
Дата
Msg-id 8436.1284990242@sss.pgh.pa.us
обсуждение исходный текст
Ответ на pg_relation_size / could not open relation with OID #  (tv@fuzzy.cz)
Ответы Re: pg_relation_size / could not open relation with OID #  (Tomas Vondra <tv@fuzzy.cz>)
Список pgsql-general
tv@fuzzy.cz writes:
> I've run into a strange problem with system catalogs - we're collecting
> database stats periodically (every 10 minutes), and from time to time we
> get the following error:

> --------------------------------------------------
> ERROR:  could not open relation with OID 154873708
> --------------------------------------------------

I think you're probably hitting a problem with a table being deleted
while you're scanning pg_class.  pg_relation_size() will fail if the
given OID isn't valid "now" --- but the underlying query returns all
OIDs that were valid when the transaction or statement snapshot was
taken.  So you have a race condition.

You might consider excluding temp tables from the query, if that's the
most likely source of the problem.

            regards, tom lane

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

Предыдущее
От: Willy-Bas Loos
Дата:
Сообщение: Re: where does postgres keep the query result until it is returned?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: where does postgres keep the query result until it is returned?