This is an automated email from the ASF dual-hosted git repository.

ztao1987 pushed a commit to branch taoz
in repository https://gitbox.apache.org/repos/asf/hawq.git

commit e16eaf418e68683107514b03f97db74dafa99067
Author: ztao1987 <[email protected]>
AuthorDate: Wed Aug 14 15:13:47 2019 +0800

    fix deadlock error info
---
 src/backend/commands/tablecmds.c | 30 +-----------------------------
 1 file changed, 1 insertion(+), 29 deletions(-)

diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index c920260..2ac9ee3 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -1709,35 +1709,7 @@ ExecuteTruncate(TruncateStmt *stmt)
                        Relation        rel;
                        PartitionNode *pNode;
 
-                       PG_TRY();
-                       {
-                               rel = heap_openrv(rv, AccessExclusiveLock);
-                       }
-                       
-                       PG_CATCH();
-                       {
-                               /* 
-                                * In the case of the table being dropped 
concurrently, 
-                                * throw a friendlier error than:
-                                * 
-                                * "could not open relation with relid 1234"
-                                */
-                               if (rv->schemaname)
-                                       ereport(ERROR,
-                                                       
(errcode(ERRCODE_UNDEFINED_TABLE),
-                                                        errmsg("relation 
\"%s.%s\" does not exist",
-                                                                       
rv->schemaname, rv->relname),
-                                                        
errOmitLocation(true)));
-                               else
-                                       ereport(ERROR,
-                                                       
(errcode(ERRCODE_UNDEFINED_TABLE),
-                                                        errmsg("relation 
\"%s\" does not exist",
-                                                                       
rv->relname),
-                                                        
errOmitLocation(true)));
-                               PG_RE_THROW();
-                       }
-                       PG_END_TRY();
-                       
+                 rel = heap_openrv(rv, AccessExclusiveLock);
                        truncate_check_rel(rel);
 
                        if (partcheck == 2)

Reply via email to