Re: pg_autovacuum patch for 7.4.2 and HEAD - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: pg_autovacuum patch for 7.4.2 and HEAD
Date
Msg-id 200403151617.i2FGHYt10308@candle.pha.pa.us
Whole thread Raw
In response to Re: pg_autovacuum patch for 7.4.2 and HEAD  ("Matthew T. O'Connor" <matthew@zeut.net>)
List pgsql-patches
Patch applied.  Thanks.

---------------------------------------------------------------------------


Matthew T. O'Connor wrote:
> Tom Lane wrote:
>
> >"Matthew T. O'Connor" <matthew@zeut.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.
>
>
> Matthew
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
>                http://archives.postgresql.org
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [pgsql-hackers-win32] initdb problen
Next
From: Bruce Momjian
Date:
Subject: Re: misc patches (minor)