Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pKawG-0007qD-V0 for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Jan 2023 08:15:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pKawE-0003O8-US for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Jan 2023 08:15:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pKawE-0003Nz-LJ for pgsql-hackers@lists.postgresql.org; Wed, 25 Jan 2023 08:15:22 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pKaw7-0000Na-EQ for pgsql-hackers@lists.postgresql.org; Wed, 25 Jan 2023 08:15:22 +0000 Received: from oss.nttdata.com (localhost [127.0.0.1]) by oss.nttdata.com (Postfix) with ESMTPA id 2BC906099C; Wed, 25 Jan 2023 17:15:10 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.7 at oss.nttdata.com MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 25 Jan 2023 17:15:10 +0900 From: Katsuragi Yuta To: "Hayato Kuroda (Fujitsu)" Cc: 'Ted Yu' , Tom Lane , vignesh C , pgsql-hackers@lists.postgresql.org, =?UTF-8?Q?=C3=96nder_Kalac=C4=B1?= , Fujii Masao , Shinya11.Kato@oss.nttdata.com, Kyotaro Horiguchi Subject: Re: [Proposal] Add foreign-server health checks infrastructure In-Reply-To: References: <20221206182638.w3vrfal4qix4hf2w@awork3.anarazel.de> <204604.1673324688@sss.pgh.pa.us> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <20a2c622cd4d763cf0b09b395a953ccc@oss.nttdata.com> X-Sender: katsuragiy@oss.nttdata.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2023-01-23 14:40, Hayato Kuroda (Fujitsu) wrote: > Dear Ted, > > Thanks for reviewing! PSA new version. > >> For v25-0001-Add-PQConnCheck-and-PQCanConnCheck-to-libpq.patch , >> `pqConnCheck_internal` only has one caller which is quite short. >> Can pqConnCheck_internal and PQConnCheck be merged into one func ? > > I divided the function for feature expandability. Currently it works > on linux platform, > but the limitation should be removed in future and internal function > will be longer. > Therefore I want to keep this style. > >> +int >> +PQCanConnCheck(void) >> >> It seems the return value should be of bool type. > > I slightly changed the returned value like true/false. But IIUC libpq > functions > cannot define as "bool" datatype. E.g. PQconnectionNeedsPassword() > returns true/false, > but the function is defined as int. > > Best Regards, > Hayato Kuroda > FUJITSU LIMITED Thank you for updating the patch! +/* Check whether the postgres server is still alive or not */ +extern int PQConnCheck(PGconn *conn); +extern int PQCanConnCheck(void); Aren't these PQconnCheck and PQcanConnCheck? I think the first letter following 'PQ' should be lower case. regards. -- Katsuragi Yuta Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION