BUG #16622: pg_dump produces erroneus ALTER TABLE statement for a table with an inherited generated column

Поиск
Список
Период
Сортировка
От PG Bug reporting form
Тема BUG #16622: pg_dump produces erroneus ALTER TABLE statement for a table with an inherited generated column
Дата
Msg-id 16622-779a79851b4e2491@postgresql.org
обсуждение исходный текст
Ответы Re: BUG #16622: pg_dump produces erroneus ALTER TABLE statement for a table with an inherited generated column  (Daniel Gustafsson <daniel@yesql.se>)
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      16622
Logged by:          Andrew Bille
Email address:      andrewbille@gmail.com
PostgreSQL version: 12.4
Operating system:   Ubuntu-20.04
Description:

When I perform dump/reload with the following inherited table:

CREATE TABLE public.gtest1 (
    a integer NOT NULL,
    b integer GENERATED ALWAYS AS ((a * 2)) STORED
);

CREATE TABLE public.gtest1_1 (
)
INHERITS (public.gtest1);

I get the error:

pg_dump postgres > dump.sql
createdb test
psql test -q -v ON_ERROR_STOP=1 -f dump.sql
psql:dump.sql:50: ERROR:  column "b" of relation "gtest1_1" is a generated
column

in dump.sql i see
...
--
-- Name: gtest1; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.gtest1 (
    a integer NOT NULL,
    b integer GENERATED ALWAYS AS ((a * 2)) STORED
);


ALTER TABLE public.gtest1 OWNER TO postgres;

--
-- Name: gtest1_1; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.gtest1_1 (
)
INHERITS (public.gtest1);


ALTER TABLE public.gtest1_1 OWNER TO postgres;

--
-- Name: gtest1_1 b; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.gtest1_1 ALTER COLUMN b SET DEFAULT (a * 2);
...

Reproduced on 13rc1 too.


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

Предыдущее
От: Tomasz Szypowski
Дата:
Сообщение: MinGW compilation
Следующее
От: PG Bug reporting form
Дата:
Сообщение: BUG #16623: JSON select query result is getting differed when we change DB version