diff --git a/web/pgadmin/tools/sqleditor/utils/get_column_types.py b/web/pgadmin/tools/sqleditor/utils/get_column_types.py index 72afef66f..3af6b72b5 100644 --- a/web/pgadmin/tools/sqleditor/utils/get_column_types.py +++ b/web/pgadmin/tools/sqleditor/utils/get_column_types.py @@ -12,7 +12,8 @@ """ from flask import render_template -from pgadmin.utils.exception import ExecuteError +from flask_babel import gettext +from pgadmin.utils.exception import ExecuteError, ObjectGone def get_columns_types(is_query_tool, columns_info, table_oid, conn, has_oids): @@ -25,6 +26,10 @@ def get_columns_types(is_query_tool, columns_info, table_oid, conn, has_oids): ) colst, rset = conn.execute_2darray(query) + # If no record found consider table is deleted, raise error + if len(rset['rows']) == 0: + raise ObjectGone(gettext("The specified object could not be found.")) + if not colst: raise ExecuteError(rset)