yugabyte / yugabyte-db

YugabyteDB - the cloud native distributed SQL database for mission-critical applications.
https://www.yugabyte.com
Other
9.04k stars 1.08k forks source link

[YSQL] PG15 Online Upgrade fails with CREATE TABLE ... OF #24982

Closed timothy-e closed 5 hours ago

timothy-e commented 6 days ago

Jira Link: DB-14127

Description

create type rewritetype as (a int);
create table rewritemetoo1 of rewritetype;

Excluding ownership and boilerplate, the pg_dump output is:

CREATE TYPE "public"."rewritetype" AS (
    "a" integer
);

CREATE TABLE "public"."rewritemetoo1" (
    "a" integer
);

-- For binary upgrade, set up typed tables this way.
ALTER TABLE ONLY "public"."rewritemetoo1" OF "public"."rewritetype";

pg_restore fails with the output:

pg_restore: error: could not execute query: ERROR:  ALTER action OF not supported yet
LINE 2: ALTER TABLE ONLY "public"."rewritemetoo1" OF "public"."rewri...
                                                  ^
HINT:  See https://github.com/yugabyte/yugabyte-db/issues/1124. React with thumbs up to raise its priority
Command was:  ALTER TABLE ONLY "public"."rewritemetoo1" OF "public"."rewritetype";

We should either make this a preflight check, support ALTER TABLE OF, or change the pg_dump output to avoid alter table.

Issue Type

kind/bug

Warning: Please confirm that this issue does not contain any sensitive information