From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Cc: bt21masumurak <bt21masumurak@oss.nttdata.com>
Cc: Daniel Gustafsson <daniel@yesql.se>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Improve the HINT message of the ALTER command for postgres_fdw
Date: Mon, 25 Oct 2021 15:30:23 +0900
Message-ID: <33141684-a9bd-aea8-e05c-2826411c70fd@oss.nttdata.com> (raw)
In-Reply-To: <CALj2ACU_hHxz=Jdfsx6-eRyN872bYfec_gtLb130Umef=oXhQw@mail.gmail.com>
References: <557d06cebe19081bfcc83ee2affc98d3@oss.nttdata.com>
<CALj2ACUkZ9FWZA0XgjBeMX-M_Pg2Z=xhvFsy39X6699jDWr5xw@mail.gmail.com>
<250E9750-57EA-45BA-82A4-787CC61F7309@yesql.se>
<46864d7a8ca6c2faeb2f9a7a401d47c0@oss.nttdata.com>
<595194b4-20e1-58a5-4413-c0c7a1aee004@oss.nttdata.com>
<CALj2ACU7XhadSLpT1x3988RY5ryZRGqo+vwRVF+zmaedzmhi2A@mail.gmail.com>
<4dbda741-2e88-fd07-c2a6-396d776ccf20@oss.nttdata.com>
<CALj2ACU_hHxz=Jdfsx6-eRyN872bYfec_gtLb130Umef=oXhQw@mail.gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: masao.fujii@oss.nttdata.com, bharath.rupireddyforpostgres@gmail.com, bt21masumurak@oss.nttdata.com, daniel@yesql.se
Subject: Re: Improve the HINT message of the ALTER command for postgres_fdw
In-Reply-To: <33141684-a9bd-aea8-e05c-2826411c70fd@oss.nttdata.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox