test_backup=# CREATE TABLE public.test3( test_backup(# id SERIAL, test_backup(# name TEXT, test_backup(# test_date date test_backup(# ) test_backup-# DISTRIBUTED BY (id); NOTICE: CREATE TABLE will create implicit sequence "test3_id_seq" for serial column "test3.id" CREATE TABLE test_backup=# test_backup=# create unique index test3_pkey ON public.test3 USING btree(id); CREATE INDEX test_backup=# test_backup=# alter table public.test3 ADD PRIMARY KEY(id); NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index "test3_pkey1" for table "test3" ALTER TABLEBy default the primary key would have the name "<tablename>_pkey", but as that name is already in use, a "1" is added to the end of the name, "test3_pkey1" in the above example.
20220421:15:36:22 gprestore:gpadmin:support-gpddb6-mdw:032733-[INFO]:-Restoring post-data metadata Post-data objects restored: 0 / 2 [-------------------------------------------------------] 0.00% 20220421:15:36:22 gprestore:gpadmin:support-gpddb6-mdw:032733-[CRITICAL]:-ERROR: relation "test3_pkey" already exists (SQLSTATE 42P07)
ALTER TABLE ONLY public.test3 ADD CONSTRAINT test3_pkey PRIMARY KEY (id); CREATE UNIQUE INDEX test3_pkey ON public.test3 USING btree (id);
This issue should only occur when the source cluster is Greenplum 4.3.x.
The error will be reported regardless of the Greenplum versionĀ on the target cluster as the dump information will try to create two indices with the same name.
There is no issue if the source cluster is running Greenplum 5.x or 6.x as the dump will record the correct name for the primary key.