Re: Improve the HINT message of the ALTER command for postgres_fdw

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: bt21masumurak <bt21masumurak(at)oss(dot)nttdata(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Improve the HINT message of the ALTER command for postgres_fdw
Date: 2021-10-08 07:38:57
Message-ID: CALj2ACUkZ9FWZA0XgjBeMX-M_Pg2Z=xhvFsy39X6699jDWr5xw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Oct 8, 2021 at 12:48 PM bt21masumurak
<bt21masumurak(at)oss(dot)nttdata(dot)com> wrote:
>
> Hi
>
> When 'ALTER FOREIGN DATA WRAPPER OPTIONS' is executed against
> postgres_fdw, the HINT message is printed as shown below, even though
> there are no valid options in this context.
>
> =# ALTER FOREIGN DATA WRAPPER postgres_fdw OPTIONS (format 'csv');
> ERROR: invalid option "format"
> HINT: Valid options in this context are:
>
> I made a patch for this problem.

Good catch. It seems like the change proposed for
postgres_fdw_validator is similar to what file_fdw is doing in
file_fdw_validator. I think we also need to do the same change in
dblink_fdw_validator and postgresql_fdw_validator as well.

While on this, it's better to add test cases for the error message
"There are no valid options in this context." for all the three fdws
i.e. file_fdw, postgres_fdw and dblink_fdw may be in their respective
contrib modules test files, and for postgresql_fdw_validator in
src/test/regress/sql/foreign_data.sql.

Regards,
Bharath Rupireddy.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2021-10-08 07:50:55 Re: [BUG] Logical replication failure "ERROR: could not map filenode "base/13237/442428" to relation OID" with catalog modifying txns
Previous Message Fabrice Chapuis 2021-10-08 07:33:40 Re: Logical replication timeout problem