While restoring -getting error if dump contain sql statementsgenerated from generated.sql file

Поиск
Список
Период
Сортировка
От tushar
Тема While restoring -getting error if dump contain sql statementsgenerated from generated.sql file
Дата
Msg-id 2678bad1-048f-519a-ef24-b12962f41807@enterprisedb.com
обсуждение исходный текст
Ответы Re: While restoring -getting error if dump contain sql statementsgenerated from generated.sql file
Список pgsql-hackers
Hi ,

We have a sql file  called 'generated.sql' under src/test/regress/sql 
folder . if we run this file on psql , take the dump and try to restore 
it on another db
we are getting error like -

psql:/tmp/x:434: ERROR:  column "b" of relation "gtest1_1" is a 
generated column
psql:/tmp/x:441: ERROR:  cannot use column reference in DEFAULT expression

These sql statements , i copied from the dump file

postgres=# CREATE TABLE public.gtest30 (
postgres(#     a integer,
postgres(#     b integer
postgres(# );
CREATE TABLE
postgres=#
postgres=# CREATE TABLE public.gtest30_1 (
postgres(# )
postgres-# INHERITS (public.gtest30);
CREATE TABLE
postgres=# ALTER TABLE ONLY public.gtest30_1 ALTER COLUMN b SET DEFAULT 
(a * 2);
ERROR:  cannot use column reference in DEFAULT expression
postgres=#

Steps to reproduce -

connect to psql - ( ./psql postgres)
create database ( create database x;)
connect to database x (\c x )
execute generated.sql file (\i ../../src/test/regress/sql/generated.sql)
take the dump of x db (./pg_dump -Fp x > /tmp/t.dump)
create another database  (create database y;)
Connect to y db (\c y)
execute plain dump sql file (\i /tmp/t.dump)

-- 
regards,tushar
EnterpriseDB  https://www.enterprisedb.com/
The Enterprise PostgreSQL Company




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

Предыдущее
От: Kashif Zeeshan
Дата:
Сообщение: Re: WIP/PoC for parallel backup
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Race condition in SyncRepGetSyncStandbysPriority