dimitri / pgcopydb

Copy a Postgres database to a target Postgres server (pg_dump | pg_restore on steroids)
Other
1.16k stars 76 forks source link

ERROR: relation "xxxx" does not exist, during data copy phase. #875

Open VaibhaveS opened 1 month ago

VaibhaveS commented 1 month ago
2024-07-16 20:55:09.167 249 ERROR  pgsql.c:2331              [SOURCE 351740] ERROR:  relation "ora.xyz" does not exist
2024-07-16 20:55:09.168 249 ERROR  pgsql.c:2331              [SOURCE 351740] ERROR:  relation "ora.xyz" does not exist
2024-07-16 20:55:09.168 249 ERROR  pgsql.c:2342              [SOURCE 351740] SQL query: LOCK TABLE ONLY ora."xyz" IN ACCESS SHARE MODE
2024-07-16 20:55:09.168 249 ERROR  pgsql.c:2350              [SOURCE 351740] SQL params:  
2024-07-16 20:55:09.168 249 ERROR  table-data.c:1523         Failed to LOCK table ora."xyz" in ACCESS SHARE mode
2024-07-16 20:55:09.170 249 ERROR  pgsql.c:2331              [SOURCE 351740] ERROR:  current transaction is aborted, commands ignored until end of transaction block

In copydb_check_table_exists we do the following,

check if it exists -> lock -> check if it exists.

The situation is that the lock query failed because the table was dropped, and it appears we are verifying its existence within the same transaction, but since its invalid we error out.