Re: BUG #17872: Dropping an attribute of a composite type breaks indexes over the type silently
В списке pgsql-bugs по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: BUG #17872: Dropping an attribute of a composite type breaks indexes over the type silently |
| Дата | |
| Msg-id | 3169550.1679928579@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | BUG #17872: Dropping an attribute of a composite type breaks indexes over the type silently (PG Bug reporting form <noreply@postgresql.org>) |
| Ответы |
Re: BUG #17872: Dropping an attribute of a composite type breaks indexes over the type silently
|
| Список | pgsql-bugs |
PG Bug reporting form <noreply@postgresql.org> writes:
> The following script:
> CREATE TYPE ctype AS (i int, j int);
> CREATE TABLE ctbl(a int, cf ctype);
> CREATE UNIQUE INDEX ctbl_idx ON ctbl(cf);
> INSERT INTO ctbl VALUES (1, '(1, 2)'::ctype), (2, '(1, 1)'::ctype);
> ALTER TYPE ctype DROP ATTRIBUTE j;
> Results in the UNIQUE constraint broken:
> SELECT ctid, * FROM ctbl;
> ctid | a | cf
> -------+---+-----
> (0,1) | 1 | (1)
> (0,2) | 2 | (1)
Meh. I'm happy to classify this as "so don't do that".
The cost of having ALTER TYPE detect such situations seems
vastly out of proportion to the value (and I think it'd
be impossible to prevent race conditions in the detection
anyway).
regards, tom lane
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера