ALTER tbl rewrite loses CLUSTER ON index

Поиск
Список
Период
Сортировка
От Justin Pryzby
Тема ALTER tbl rewrite loses CLUSTER ON index
Дата
Msg-id 20200202161718.GI13621@telsasoft.com
обсуждение исходный текст
Ответы Re: ALTER tbl rewrite loses CLUSTER ON index  (Amit Langote <amitlangote09@gmail.com>)
Список pgsql-hackers
Other options are preserved by ALTER (and CLUSTER ON is and most obviously
should be preserved by CLUSTER's rewrite), so I think (SET) CLUSTER should be
preserved by ALTER, too.

As far as I can see, this should be the responsibility of something in the
vicinity of ATPostAlterTypeParse/RememberIndexForRebuilding.

Attach patch sketches a fix.

ts=# SET client_min_messages=debug; DROP TABLE t; CREATE TABLE t(i int); CREATE INDEX ON t(i)WITH(fillfactor=11,
vacuum_cleanup_index_scale_factor=12);CLUSTER t USING t_i_key; ALTER TABLE t ALTER i TYPE bigint; \d t
 
SET
DEBUG:  drop auto-cascades to type t
DEBUG:  drop auto-cascades to type t[]
DEBUG:  drop auto-cascades to index t_i_idx
DROP TABLE
CREATE TABLE
DEBUG:  building index "t_i_idx" on table "t" serially
CREATE INDEX
ERROR:  index "t_i_key" for table "t" does not exist
DEBUG:  rewriting table "t"
DEBUG:  building index "t_i_idx" on table "t" serially
DEBUG:  drop auto-cascades to type pg_temp_3091172777
DEBUG:  drop auto-cascades to type pg_temp_3091172777[]
ALTER TABLE
                 Table "public.t"
 Column |  Type  | Collation | Nullable | Default 
--------+--------+-----------+----------+---------
 i      | bigint |           |          | 
Indexes:
    "t_i_idx" btree (i) WITH (fillfactor='11', vacuum_cleanup_index_scale_factor='12')

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Daniel Gustafsson
Дата:
Сообщение: Re: BUG #16171: Potential malformed JSON in explain output
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #16171: Potential malformed JSON in explain output