Re: Fix tab completion after EXCEPT (...) in IMPORT FOREIGN SCHEMA

From: shveta malik <shveta(dot)malik(at)gmail(dot)com>
To: vignesh C <vignesh21(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, shveta malik <shveta(dot)malik(at)gmail(dot)com>
Subject: Re: Fix tab completion after EXCEPT (...) in IMPORT FOREIGN SCHEMA
Date: 2026-04-16 03:59:41
Message-ID: CAJpy0uAbEk55GCM1huYaZZWsPMDeLuOcUDTBP9ozdhjpV4ONxw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Apr 15, 2026 at 8:45 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
>
> Hi all,
>
> While reviewing tab completion behavior, I noticed an issue after
> EXCEPT (...) support was added to CREATE PUBLICATION.
> Currently, after typing:
> IMPORT FOREIGN SCHEMA public EXCEPT (t1)
>
> psql correctly suggests FROM SERVER. However, the existing completion
> rule uses a generic:
> TailMatches("EXCEPT", "(*)")
>
> Previously this was safe because no other command used EXCEPT (...).
> Now that CREATE PUBLICATION also supports EXCEPT (...), the same rule
> can incorrectly match publication commands and suggest FROM SERVER
> there as well.
>
> The attached patch fixes this by restricting the EXCEPT (...) path to
> IMPORT FOREIGN SCHEMA using HeadMatches(), while preserving the
> existing LIMIT TO (...) behavior.
>

I can reproduce the problem without the patch. The patch looks good to me.

thanks
Shveta

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-04-16 04:02:48 Re: Use proc_exit() in WalRcvWaitForStartPosition
Previous Message Fujii Masao 2026-04-16 03:34:40 Re: Use proc_exit() in WalRcvWaitForStartPosition