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 1metVD-0000HX-5j for pgsql-hackers@arkaria.postgresql.org; Mon, 25 Oct 2021 06:30:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1metVA-0002tr-UB for pgsql-hackers@arkaria.postgresql.org; Mon, 25 Oct 2021 06:30:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1metVA-0002mI-G3 for pgsql-hackers@lists.postgresql.org; Mon, 25 Oct 2021 06:30:32 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1metV6-00058r-VP for pgsql-hackers@postgresql.org; Mon, 25 Oct 2021 06:30:30 +0000 Received: from hrk.local (sp49-98-211-121.msd.spmode.ne.jp [49.98.211.121]) by oss.nttdata.com (Postfix) with ESMTPSA id 6DB2760793; Mon, 25 Oct 2021 15:30:24 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.3 at oss.nttdata.com Subject: Re: Improve the HINT message of the ALTER command for postgres_fdw To: Bharath Rupireddy Cc: bt21masumurak , Daniel Gustafsson , pgsql-hackers References: <557d06cebe19081bfcc83ee2affc98d3@oss.nttdata.com> <250E9750-57EA-45BA-82A4-787CC61F7309@yesql.se> <46864d7a8ca6c2faeb2f9a7a401d47c0@oss.nttdata.com> <595194b4-20e1-58a5-4413-c0c7a1aee004@oss.nttdata.com> <4dbda741-2e88-fd07-c2a6-396d776ccf20@oss.nttdata.com> From: Fujii Masao Message-ID: <33141684-a9bd-aea8-e05c-2826411c70fd@oss.nttdata.com> Date: Mon, 25 Oct 2021 15:30:23 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021/10/16 19:43, Bharath Rupireddy wrote: > I'm fine with the distinction that's made, now I'm thinking about the > appropriate areas where ERRCODE_FDW_INVALID_OPTION_NAME can be used. > Is it correct to use ERRCODE_FDW_INVALID_OPTION_NAME in > postgresImportForeignSchema where we don't check buffer length and > option name length but throw the error when we don't find what's being > expected for IMPORT FOREIGN SCHEMA command? Isn't it the > ERRCODE_FDW_OPTION_NAME_NOT_FOUND right choice there? I've seen some > of the option parsing logic(with the search text "stmt->options)" in > the code base), they are mostly using "option \"%s\" not recognized" > without an error code or "unrecognized XXXX option \"%s\"" with > ERRCODE_SYNTAX_ERROR. I'm not sure which is right. If not in > postgresImportForeignSchema, where else can > ERRCODE_FDW_INVALID_OPTION_NAME be used? These are good questions. But TBH I don't know the answers and have not found good articles describing more detail definitions of those error codes. I'm tempted to improve the HINT message part at first because it has obviously an issue. And then we can consider what error code should be used in FDW layer if necessary. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION