can we use different function in place of atoi in vacuumdb.c file

From: Mahendra Singh Thalor <mahi6run(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: can we use different function in place of atoi in vacuumdb.c file
Date: 2020-01-23 12:55:43
Message-ID: CAKYtNAp0ySG_FK60BaWNu6baYvXSDLyijPsiTeHNbwk+nrOwgw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,
While reviewing one patch, I found that if we give any non-integer string
to atoi (say aa), then it is returning zero(0) as output so we are not
giving any error(assuming 0 as valid argument) and continuing our
operations.

Ex:
Let say, we gave "-P aa" (patch is in review[1]), then it will disable
parallel vacuum because atoi is returning zero as parallel degree but
ideally it should give error or at least it should not disable parallel
vacuum.

I think, in-place of atoi, we should use different function ( defGetInt32,
strtoint) or we can write own function.

Thoughts?

[1]:
https://www.postgresql.org/message-id/CA%2Bfd4k6DgwtQSr4%3DUeY%2BWbGuF7-oD%3Dm-ypHPy%2BsYHiXZc%2BhTUQ%40mail.gmail.com
--
Thanks and Regards
Mahendra Singh Thalor
EnterpriseDB: http://www.enterprisedb.com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2020-01-23 13:14:48 Re: table partitioning and access privileges
Previous Message Kyotaro Horiguchi 2020-01-23 12:33:25 Re: [HACKERS] Restricting maximum keep segments by repslots