Re: pg_relation_size / could not open relation with OID #

Поиск
Список
Период
Сортировка
От Greg Smith
Тема Re: pg_relation_size / could not open relation with OID #
Дата
Msg-id 4CADCE3E.60705@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: pg_relation_size / could not open relation with OID #  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: pg_relation_size / could not open relation with OID #  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Tom Lane wrote:
> We could prevent your query from failing if we did something like having
> pg_relation_size() return NULL, rather than throwing an error, if the
> OID it's given doesn't turn out to correspond to a live table.  I'm not
> sure if that'd be a net improvement or not --- it certainly seems to
> reduce the system's ability to detect simple errors

I've struggled with scripts using pg_relation_size doing strange things
because of this more than once.  How about a) return NULL and b) log at
NOTICE that you just asked for something undefined?  That would let
scripts run without interruption in some of these race condition cases,
while still generating some clue the user was likely to see that there
was a problem when people were just using the thing blatantly wrong--the
biggest subset of cases that produce errors now I suspect.

--
Greg Smith, 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD
PostgreSQL Training, Services and Support  www.2ndQuadrant.us



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

Предыдущее
От: Bill Moran
Дата:
Сообщение: Re: VACUUM FULL for performance
Следующее
От: Tom Lane
Дата:
Сообщение: Re: stuck spinlock detected at dynahash.c