Re: BUG #17706: ALTER TYPE leads to crash

From: Sergey Shinderuk <s(dot)shinderuk(at)postgrespro(dot)ru>
To: Richard Guo <guofenglinux(at)gmail(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17706: ALTER TYPE leads to crash
Date: 2022-12-13 06:58:12
Message-ID: 249fa239-3e30-6060-087d-394f36c498f6@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2022-12-13 07:50:36 BUG #17716: walsender process hang while decoding 'DROP PUBLICATION' XLOG
Previous Message David G. Johnston 2022-12-13 03:45:13 Re: BUG #17706: ALTER TYPE leads to crash