Open d3xter opened 7 months ago
I got the same error while executing a request for creating a table from a select query. Example: create table foo as select * from bar;
.
But this error appears only when the request is executed from a View/Edit Data tab converted to a Query Tool tab.
When executed directly in a Query Tool tab everything works as expected.
Tested and verified on snapshot build: https://www.postgresql.org/ftp/pgadmin/pgadmin4/snapshots/2024-04-26/ Environment: macOs Ventura 13.5.1 Package: arm64
I'm getting the same error when trying to query a foreign table.
'ForeignTableCommand' object has no attribute 'auto_commit'Successfully run. Total query runtime: 141 msec.
If I run the same query in a new query tool window it runs fine and returns results.
Successfully run. Total query runtime: 13 secs 726 msec.
I do also get the same error 'ForeignTableCommand' object has no attribute 'auto_commit'
with PgAdmin version 8.12, operating system Alpine Linux v3.20, Linux-5.4.0-200-generic-x86_64-with
This issue should be reopened
@khushboovashi
Can you please check this issue again with Foreign Table
Describe the bug
When changing the SELECT query of a View, no rows are displayed and "Total rows 0 of x" is shown at the bottom.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Rows are shown
Error message
2024-04-17 00:00:17,593: ERROR pgadmin: 'ViewCommand' object has no attribute 'auto_commit' Traceback (most recent call last): File "/usr/pgadmin4/venv/lib64/python3.12/site-packages/flask/app.py", line 1484, in full_dispatch_request rv = self.dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/pgadmin4/venv/lib64/python3.12/site-packages/flask/app.py", line 1469, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(*view_args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/pgadmin4/venv/lib64/python3.12/site-packages/flask_login/utils.py", line 290, in decorated_view return current_app.ensure_sync(func)(args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/pgadmin4/web/pgadmin/tools/sqleditor/init.py", line 887, in start_query_tool return StartRunningQuery(blueprint, current_app.logger).execute( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/pgadmin4/web/pgadmin/tools/sqleditor/utils/start_running_query.py", line 93, in execute self.__execute_query( File "/usr/pgadmin4/web/pgadmin/tools/sqleditor/utils/start_running_query.py", line 140, in __execute_query if StartRunningQuery.is_begin_required_for_sql_query(trans_obj, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/pgadmin4/web/pgadmin/tools/sqleditor/utils/start_running_query.py", line 177, in is_begin_required_for_sql_query return (not trans_obj.auto_commit and ^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'ViewCommand' object has no attribute 'auto_commit'
Screenshots
Original query:
After changing the query:
Desktop (please complete the following information):