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

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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Matthew T(dot) O'Connor" <matthew(at)zeut(dot)net>
Cc: daveg <daveg(at)sonic(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 16:30:27
Message-ID: 11485.1129825827@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-patches
"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.)

			regards, tom lane

In response to

Responses

pgsql-patches by date

Next:From: Andrew DunstanDate: 2005-10-20 16:33:48
Subject: Re: patch for pg_autovacuum 8.0.x prevent segv for dropped
Previous:From: Chris BrowneDate: 2005-10-20 16:27:41
Subject: AIX FAQ update for 5.3 socket address size issue

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