Re: BUG #17706: ALTER TYPE leads to crash

Поиск
Список
Период
Сортировка
От Richard Guo
Тема Re: BUG #17706: ALTER TYPE leads to crash
Дата
Msg-id CAMbWs48eGK9YwbSprdwN4jWGeeC7xLLehb1ymFeZKFsTO9BmOg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #17706: ALTER TYPE leads to crash  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: BUG #17706: ALTER TYPE leads to crash  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: BUG #17706: ALTER TYPE leads to crash  (Sergey Shinderuk <s.shinderuk@postgrespro.ru>)
Список pgsql-bugs

On Thu, Dec 8, 2022 at 1:01 PM David G. Johnston <david.g.johnston@gmail.com> wrote:
We don't need to fix this though (i.e., make the query continue to somehow work), we need to detect the situation and return some kind of error as opposed to crashing the server.  The transaction itself is doing something illegal and can be forced to abort.  Alternatively, maybe the ALTER TYPE command can emit the error that it is unable to alter the type as it is already in use by the current session.  But that would close off possible non-problematic uses of ALTER TYPE in this situation
 
Yeah, that makes sense.  If we create a table using type foo, the alter
operation would error out like that.

create table t (a foo);

alter type foo alter attribute b type text;
ERROR:  cannot alter type "foo" because column "t.a" uses it

Maybe we can likewise record the dependencies for the type if it's being
used in other more scenarios besides as a column in some table?

Thanks
Richard

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

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: BUG #17710: Slow queries (100% CPU) after auto-vacuum
Следующее
От: Richard Guo
Дата:
Сообщение: Re: BUG #17713: Assert with postgres_fdw in v12