ALTER INDEX documentation is incomplete

Started by PG Bug reporting formover 1 year ago3 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/17/sql-alterindex.html
Description:

I am trying to find out whether the syntax `ALTER INDEX name ATTACH
PARTITION index_name` accepts a schema-qualified index_name. However, there
is no further reference to the index_name variable in the rest of the page.
I believe this variable should be referenced in the Parameters section.
Thanks!

#2Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: PG Bug reporting form (#1)
Re: ALTER INDEX documentation is incomplete

Hello Alvaro,

On 2024-Oct-18, PG Doc comments form wrote:

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/17/sql-alterindex.html
Description:

I am trying to find out whether the syntax `ALTER INDEX name ATTACH
PARTITION index_name` accepts a schema-qualified index_name. However, there
is no further reference to the index_name variable in the rest of the page.
I believe this variable should be referenced in the Parameters section.

Hmm, you're right. It can be schema-qualified btw:

create table datadog (a int) partition by list (a);
-- CREATE TABLE
create index on only datadog (a);
-- CREATE INDEX
create schema test
create table datadog1 partition of public.datadog for values in (1)
create index on datadog1 (a);
-- CREATE SCHEMA
alter index datadog_a_idx attach partition test.datadog1_a_idx;
-- ALTER INDEX

How about the attached patch?

Regards

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"I dream about dreams about dreams", sang the nightingale
under the pale moon (Sandman)

Attachments:

alterindex.patchtext/x-diff; charset=utf-8Download+3-2
#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#2)
Re: ALTER INDEX documentation is incomplete

=?utf-8?Q?=C3=81lvaro?= Herrera <alvherre@alvh.no-ip.org> writes:

How about the attached patch?

Instead of

+ Causes the possibly schema-qualified named index to become attached

I think something like

+ Causes the named index (possibly schema-qualified) to become attached

would be more readable and closer to what we write elsewhere.

regards, tom lane