RE: make MaxBackends available in _PG_init

From: "wangsh(dot)fnst(at)fujitsu(dot)com" <wangsh(dot)fnst(at)fujitsu(dot)com>
To: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, Greg Sabino Mullane <htamfids(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: RE: make MaxBackends available in _PG_init
Date: 2021-08-15 08:04:38
Message-ID: OSBPR01MB42140A01E3441C576539AF38F2FC9@OSBPR01MB4214.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I noticed that in v3-0001-Disallow-external-access-to-MaxBackends.patch, there are some modifications like:

> - for (int i = 0; i <= MaxBackends; i++)
> + for (int i = 0; i <= GetMaxBackends(); i++)

I don't think calling function GetMaxBackends() in the for loop is a good idea. 
How about use a temp variable to save the return value of function GetMaxBackends() ?

Regards,
Shenhao Wang

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message otar shavadze 2021-08-15 11:41:31 Get table total page quantity and cached page quantity
Previous Message Tom Lane 2021-08-15 03:08:44 Re: ECPG bug fix: DECALRE STATEMENT and DEALLOCATE, DESCRIBE