On Wed, 7 May 2025 15:39:26 +0900 torikoshia <torikos...@oss.nttdata.com> wrote:
> Hi, > > I noticed that REJECT_LIMIT, an option available for COPY FROM, is not > currently supported in psql's tab completion. > > Additionally, some options are only valid for COPY FROM or COPY TO, i.e. > FREEZE, ON_ERROR, FORCE_QUOTE, but psql currently suggests them for both > COPY FROM and COPY TO. > As the number of COPY options continues to grow, I feel that having > irrelevant suggestions makes tab completion noisier. Indeed eliminating irrelevant suggestions would improve user experience, but I think there is a drawback that it increases code maintenance for adding options used both in COPY FROM and TO. This might be trivial until the number of common options are small as now, though. Perhaps, the redundant code could be reduced by preparing a list (an array of const char*) containing common options part, then appending options specific to each mode using some function like kind of append_variable_names, and passing these lists to COMPLETE_WITH_LIST. Regards, Yugo Nagata > Attached patch splits the tab completion rules between COPY FROM and > COPY TO, so that only the appropriate options are suggested for each. > > What do you think? > > > Regards, > > -- > Atsushi Torikoshi > Seconded from NTT DATA GROUP CORPORATION to SRA OSS K.K. -- Yugo Nagata <nag...@sraoss.co.jp>