Re: patch for pg_autovacuum 8.0.x prevent segv for dropped tables

From: daveg <daveg(at)sonic(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Matthew T(dot) O'Connor" <matthew(at)zeut(dot)net>, pgsql-patches(at)postgresql(dot)org
Subject: Re: patch for pg_autovacuum 8.0.x prevent segv for dropped tables
Date: 2005-10-20 19:38:42
Message-ID: 20051020193842.GD2329@sonic.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

On Thu, Oct 20, 2005 at 12:30:27PM -0400, Tom Lane wrote:
> "Matthew T. O'Connor" <matthew(at)zeut(dot)net> writes:
> > Tom Lane wrote:
> >> Surely this is completely broken? AFAICT you are testing the result
> >> from a VACUUM or ANALYZE command, which is not going to return any
> >> tuples.
>
> > Upon further inspection, I think you are right. I would think that
> > instead of checking the query result with PQntuples, it should probably
> > be checked with |PQresultStatus.
>
> ISTM this is the wrong place to test at all. I put a PQntuples check
> into update_table_thresholds() instead, which seems a far more direct
> defense against trouble. (Consider eg the case where someone drops the
> table just after your VACUUM completes successfully. Also there are
> drop/rename scenarios to think about: success of the VACUUM proves that
> there is a table named FOO, not that there is still a table with the OID
> you have on record.)

Yes, I agree, update_table_thresholds() is the right place for the check.
Please ignore the earlier patch.

Thanks

-dg

--
David Gould daveg(at)sonic(dot)net
If simplicity worked, the world would be overrun with insects.

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message David Fetter 2005-10-20 23:39:08 Error in trigger example
Previous Message Andrew Dunstan 2005-10-20 16:33:48 Re: patch for pg_autovacuum 8.0.x prevent segv for dropped