Re: WIP patch: Improve relation size functions such as pg_relation_size() to avoid producing an error when called against a no longer visible relation - Mailing list pgsql-hackers

From Phil Sorber
Subject Re: WIP patch: Improve relation size functions such as pg_relation_size() to avoid producing an error when called against a no longer visible relation
Date
Msg-id CADAkt-gVTUC_xsZyOrL0W3vieESWid7dwuUoEr=xRrMBWoUkhA@mail.gmail.com
Whole thread Raw
In response to Re: WIP patch: Improve relation size functions such as pg_relation_size() to avoid producing an error when called against a no longer visible relation  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: WIP patch: Improve relation size functions such as pg_relation_size() to avoid producing an error when called against a no longer visible relation
List pgsql-hackers
On Thu, Dec 22, 2011 at 1:33 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> I'm wondering if we oughta just return NULL and be done with it.
>
> +1.  There are multiple precedents for that sort of response, which we
> introduced exactly so that "SELECT some_function(oid) FROM some_catalog"
> wouldn't fail just because one of the rows had gotten deleted by the
> time the scan got to it.  I don't think it's necessary for the
> relation-size functions to be any smarter.  Indeed, I'd assumed that's
> all that Phil's patch did, since I'd not looked closer till just now.
>
>                        regards, tom lane

Here it is without the checking for recently dead. If it can't open
the relation it simply returns NULL.

Attachment

pgsql-hackers by date:

Previous
From: Jignesh Shah
Date:
Subject: Re: Page Checksums + Double Writes
Next
From: Andrew Dunstan
Date:
Subject: Re: reprise: pretty print viewdefs