Re: pg_autovacuum patch for 7.4.2 and HEAD

From: "Matthew T(dot) O'Connor" <matthew(at)zeut(dot)net>
To: "Matthew T(dot) O'Connor" <matthew(at)zeut(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "'pgsql-patches(at)postgresql(dot)org'" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: pg_autovacuum patch for 7.4.2 and HEAD
Date: 2004-03-13 17:01:51
Message-ID: 40533E7F.7060601@zeut.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Tom Lane wrote:

>> "Matthew T. O'Connor" <matthew(at)zeut(dot)net> writes:
>>
>>> ! new_tbl->relid = atol(PQgetvalue(res, row, PQfnumber(res,
>>> "oid")));
>>> ! new_tbl->reltuples = atof(PQgetvalue(res, row, PQfnumber(res,
>>> "reltuples")));
>>> ! new_tbl->relpages = atol(PQgetvalue(res, row, PQfnumber(res,
>>> "relpages")));
>>
>>
>> This ignores the fact that relid and relpages are unsigned. I would
>> suggest adopting the same convention for OID as is used in pg_dump and
>> other places:
>>
>> #define atooid(x) ((Oid) strtoul((x), NULL, 10))
>>
>> You could actually use this same macro for reading relpages, but that's
>> probably abusing the notation. I'd use strtoul directly for relpages,
>> I think.
>>
>>> ! init_dbinfo(char *dbname, int oid, int age)
>>> ...
>>> ! init_dbinfo(char *dbname, uint oid, uint age)
>>>
>>
>>
>> This (and other declarations) should be "Oid oid".
>
>
> Thanks for the help / review. Here is my 2nd cut at fixing this. I
> believe I have addressed the above concernes. Please review again and
> (hopefully) apply.

Ack... sorry. This time with the attachment....

Attachment Content-Type Size
pg_autovacuum.diff text/plain 11.1 KB

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2004-03-13 22:30:35 Re: costly foreign key ri checks (4)
Previous Message Matthew T. O'Connor 2004-03-13 16:50:02 Re: pg_autovacuum patch for 7.4.2 and HEAD