In 6.24.3 and below, a cascade drop of a custom type could cause a panic if that type was the partition key of a table.
Sample below shows SELECT after custom type drop causes a panic.
--- create custom type
test1=# CREATE TYPE bug_status AS ENUM ('new', 'open', 'closed');
CREATE TYPE
--- create table with above custom type as partition key
test1=# CREATE TABLE rank (id int, rank int, year int, status bug_status, count int ) with (appendonly=true)
DISTRIBUTED BY (id)
PARTITION BY LIST (status)
( PARTITION new VALUES ('new'),
PARTITION open VALUES ('open'));
NOTICE: CREATE TABLE will create partition "rank_1_prt_new" for table "rank"
NOTICE: CREATE TABLE will create partition "rank_1_prt_open" for table "rank"
CREATE TABLE
--- insert row into table above
test1=# insert into rank values(1,1,2023,'new',1);
INSERT 0 1
--- drop custom type with cascade
test1=# drop type bug_status cascade;
NOTICE: drop cascades to 3 other objects
DETAIL: drop cascades to append only table rank column status
drop cascades to append only table rank_1_prt_new column status
drop cascades to append only table rank_1_prt_open column status
DROP TYPE
--- try to select out of table after drop
test1=# select * from rank;
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.