Re: BUG #17409: Unable to alter data type of clustered column which is referenced by foreign key

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #17409: Unable to alter data type of clustered column which is referenced by foreign key
Дата
Msg-id 934540.1647020237@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #17409: Unable to alter data type of clustered column which is referenced by foreign key  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #17409: Unable to alter data type of clustered column which is referenced by foreign key  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
I wrote:
> ... The old behavior is what
> ATExecAlterColumnType wants, I judge.  As this stands, we will
> rebuild indexes that don't need to be rebuilt, and indeed might
> be on other tables altogether from the one that is being modified
> (which opens all sorts of potential locking problems).

Oh, well, not so much:

regression=# create table atref (p1 int constraint pk_atref primary key);
CREATE TABLE
regression=# create table attbl (c1 int, constraint fk_atref foreign key (c1) references atref(p1));
CREATE TABLE
regression=# cluster atref using pk_atref;
CLUSTER
regression=# alter table attbl alter column c1 set data type bigint;
ERROR:  "pk_atref" is not an index for table "attbl"

Still, that's just as unpleasant as the originally-reported case.
(I've not figured out yet why the "cluster" step is required to
make this repro work.)

            regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #17409: Unable to alter data type of clustered column which is referenced by foreign key
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #17409: Unable to alter data type of clustered column which is referenced by foreign key