diff --git a/web/pgadmin/utils/driver/psycopg3/connection.py b/web/pgadmin/utils/driver/psycopg3/connection.py index afd478260..84dd20a77 100644 --- a/web/pgadmin/utils/driver/psycopg3/connection.py +++ b/web/pgadmin/utils/driver/psycopg3/connection.py @@ -987,6 +987,11 @@ WHERE db.datname = current_database()""") except Exception: print("EXCEPTION.....") + # If multiple queries are run, make sure to reach + # the last query result + while cur.nextset(): + pass + self.row_count = cur.get_rowcount() if cur.get_rowcount() > 0: res = cur.fetchone()