-
Notifications
You must be signed in to change notification settings - Fork 801
Closed as not planned
Closed as not planned
Copy link
Labels
Description
Describe the bug
When I try to restore a backup to PostgreSQL 14, I receive an error.
To Reproduce
Steps to reproduce the behavior:
- Create an empty database (server PostgreSQL 14)
- Execute following script:
CREATE UNLOGGED TABLE IF NOT EXISTS public.table1
(
"Id" integer NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 2147483647 CACHE 1 ),
CONSTRAINT table1_pkey PRIMARY KEY ("Id")
)
- Backup database (right-click on database, choose "Backup...", fill filename, all the rest - as default)
- Try to restore backup (server PostgreSQL 14)
- See the error
Expected behavior
A backup is restored without errors.
Error message
pg_restore: error: could not execute query: ERROR: "table1_Id_seq" is not a table
Command was: ALTER TABLE public.table1 ALTER COLUMN "Id" ADD GENERATED ALWAYS AS IDENTITY (
SEQUENCE NAME public."table1_Id_seq"
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1
);
ALTER SEQUENCE public."table1_Id_seq" SET LOGGED;
Desktop (please complete the following information):
- OS: Windows 10, 22H2
- Version: 6.16, 6.17, 6.18
- Mode: Desktop
Additional context
I believe the bug was introduced with PostgreSQL 15 support, with its new feature of unlogged sequences. I guess the first version with this bug is 6.15, but i haven't tested it. Working versions I've tested - 6.9, 6.10, 6.11.