Re: ALTER INDEX fails on partitioned index - Mailing list pgsql-hackers

From Justin Pryzby
Subject Re: ALTER INDEX fails on partitioned index
Date
Msg-id 20200227232513.GE29456@telsasoft.com
Whole thread Raw
In response to Re: ALTER INDEX fails on partitioned index  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: ALTER INDEX fails on partitioned index  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: ALTER INDEX fails on partitioned index  (Michael Paquier <michael@paquier.xyz>)
Re: ALTER INDEX fails on partitioned index  (Justin Pryzby <pryzby@telsasoft.com>)
List pgsql-hackers
The attached allows CREATE/ALTER to specify reloptions on a partitioned table
which are used as defaults for future children.

I think that's a desirable behavior, same as for tablespaces.  Michael
mentioned that ALTER INDEX ONLY doesn't exist, but that's only an issue if
ALTER acts recursively, which isn't the case here.

The current behavior seems unreasonable: CREATE allows specifying fillfactor,
which does nothing, and unable to alter it, either:

postgres=# CREATE TABLE tt(i int)PARTITION BY RANGE (i);;
CREATE TABLE
postgres=# CREATE INDEX ON tt(i)WITH(fillfactor=11);
CREATE INDEX
postgres=# \d tt
...
    "tt_i_idx" btree (i) WITH (fillfactor='11')
postgres=# ALTER INDEX tt_i_idx SET (fillfactor=12);
ERROR:  "tt_i_idx" is not a table, view, materialized view, or index

Maybe there are other ALTER commands to handle (UNLOGGED currently does nothing
on a partitioned table?, STATISTICS, ...).

The first patch makes a prettier message, per Robert's suggestion.

-- 
Justin

Attachment

pgsql-hackers by date:

Previous
From: legrand legrand
Date:
Subject: Re: Implementing Incremental View Maintenance
Next
From: Tom Lane
Date:
Subject: Re: Rethinking opclass member checks and dependency strength