Re: BUG #17706: ALTER TYPE leads to crash
| От | Sergey Shinderuk |
|---|---|
| Тема | Re: BUG #17706: ALTER TYPE leads to crash |
| Дата | |
| Msg-id | 249fa239-3e30-6060-087d-394f36c498f6@postgrespro.ru обсуждение исходный текст |
| Ответ на | Re: BUG #17706: ALTER TYPE leads to crash (Richard Guo <guofenglinux@gmail.com>) |
| Список | pgsql-bugs |
On 13.12.2022 05:58, Richard Guo wrote:
> 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?
Just in case, ALTER TABLE can also trigger the crash:
create table t (a int, b int);
create function f() returns t as $$
declare
r t = (1, 2^30);
begin
alter table t alter b type text;
return r;
end;
$$ language plpgsql;
postgres=# select f();
server closed the connection unexpectedly
--
Sergey Shinderuk https://postgrespro.com/
В списке pgsql-bugs по дате отправления: