Skip site navigation (1) Skip section navigation (2)

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

From: Phil Sorber <phil(at)omniti(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, OmniTI DBA <dba(at)omniti(dot)com>
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: 2011-12-22 19:02:28
Message-ID: CADAkt-gVTUC_xsZyOrL0W3vieESWid7dwuUoEr=xRrMBWoUkhA@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Thu, Dec 22, 2011 at 1:33 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)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: improve_relation_size_functions_v3.patch
Description: text/x-patch (5.0 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Andrew DunstanDate: 2011-12-22 19:17:59
Subject: Re: reprise: pretty print viewdefs
Previous:From: Jignesh ShahDate: 2011-12-22 18:50:23
Subject: Re: Page Checksums + Double Writes

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group