Re: psql: Don't offer partitioned tables after CREATE INDEX CONCURRENTLY

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: Sho Ito <i(dot)sho(dot)0628(at)gmail(dot)com>
Cc: Ishjaap Singh <ishjaap(dot)singh07(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: psql: Don't offer partitioned tables after CREATE INDEX CONCURRENTLY
Date: 2026-11-18 11:31:50
Message-ID: av2LevIQSBw-QyrV@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

There's more to fix here. I think the rule to complete using
Query_for_list_of_concurrent_indexables after "CONCURRENTLY ON" is
obsolete, and worse, it is bogus. First, it is obsolete because if you
have a REPACK command, it will complete nonsense:

REPACK (CONCURRENTLY ON <tab>
shows a list of tables/schemas. Useless!

Second, bogus; the claim is that you need to use TailMatches() because
the CREATE INDEX command can appear as part of a CREATE SCHEMA. But
that doesn't actually work:

=# create schema foo create table bar (a int) create index concurrently on bar (a);
ERROR: CREATE INDEX CONCURRENTLY cannot be executed from a function or procedure

so trying to provide completions after
TailMatches(CONCURRENTLY MatchAny ON) or TailMatches(CONCURRENTLY ON)
is something that we need to remove, not patch.

Thanks, regards,

--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"Debido a que la velocidad de la luz es mucho mayor que la del sonido,
algunas personas nos parecen brillantes un minuto antes
de escuchar las pelotudeces que dicen." (Roberto Fontanarrosa)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Burd 2026-11-18 11:47:51 Re: Hash index: stop registering pin-only bucket pages in WAL (remove REGBUF_NO_CHANGE)
Previous Message Chengpeng Yan 2026-11-18 11:08:17 [PATCH] Fix encoding-dependent LIKE/regex selectivity estimates