Problem: Create table command fails with error ERROR: relation "abc" already exists (seg4 sdw1:40004 pid=13649). drop table command fails with error relation does not exists. Step 1: Run gpcheckcat - Run as gpadmin $GPHOME/bin/lib/gpcheckcat -p 5432 -A>checkcat_A.out 2>&1 & Step 2. Look at the checkcat_A.out and log from /home/gpadmin/gpAdminLogs/gpcheckcat_20140315.log **20140315 is the date when you ran the utility. Step 3: Shutdown the database Step 4: Starts Greenplum Database in restricted mode $gptart -R (only database superusers are allowed to connect). step 5: Run gpcheckcat - Run as gpadmin $GPHOME/bin/lib/gpcheckcat -p 5432 -B>checkcat_B.out 2>&1 & Step 6. Run gpcheckcat repair script Step 7: Run gpcheckcat - Run as gpadmin $GPHOME/bin/lib/gpcheckcat -p 5432 -C>checkcat_C.out 2>&1 & Step 8: Fix Catalog issue
Step 9: Run gpcheckcat - Run as gpadmin $GPHOME/bin/lib/gpcheckcat -p 5432 -D>checkcat_D.out 2>&1 & Note: When you run create table script inside an stored procedure/function in Greenplum and function fails then it rolls back only master but table definition in the segments exist. This is the reason of the above problem. |