1

I am running Pgadmin V4.17 on Windows 10. When I try to create a select or update sql statement for a table(with the right click on table Scripts) I got an Error window with the text "Error message" and with the caption text :Error fetching SQL for script 'attname'. The error appears on all PG databases, local or remote.

My environment as displayed by the Help is:

Version 4.17 Copyright Copyright (C) 2013 - 2020, The pgAdmin Development Team Python Version 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)] Flask Version 1.0.2 Application Mode Desktop Current User [email protected]

The last pgadmin log lines are:

*2020-01-27 17:05:32,389: ERROR flask.app: 'attname' Traceback (most recent call last): File "C:/app/pgAdmin4/v4/venv/Lib/site-packages\flask\app.py", line 1813, in full_dispatch_request rv = self.dispatch_request() File "C:/app/pgAdmin4/v4/venv/Lib/site-packages\flask\app.py", line 1799, in dispatch_request return self.view_functionsrule.endpoint File "C:/app/pgAdmin4/v4/venv/Lib/site-packages\flask\views.py", line 88, in view return self.dispatch_request(*args, **kwargs) File "C:\app\pgAdmin4\v4\web\pgadmin\browser\utils.py", line 311, in dispatch_request return method(*args, **kwargs) File "C:\app\pgAdmin4\v4\web\pgadmin\browser\server_groups\servers\databases\schemas\tables\utils.py", line 141, in wrap return f(*args, **kwargs) File "C:\app\pgAdmin4\v4\web\pgadmin\browser\server_groups\servers\databases\schemas\tables__init__.py", line 1310, in select_sql columns.append(self.qtIdent(self.conn, c['attname'])) KeyError: 'attname'*

I can write the SQL selects and run them but not generating them. Any idea?

2 Answers 2

3

I had the same problem. It was working fine with 4.16 version then I updated it and got that problem.

What I had to do is downgrade my pgAdmin version to 4.16 and now it's working.

I hope this helps.

P.D.: I wish pgAdmin developers solve this bug soon.

0
1

I just right now fixed to me my Pgadmin4 wich is a python wheel Version.

I have a pyenv-virtualenv from python 3.8 where I install pgadmin4 wheel.

I found that in that file:

~/.pyenv/versions/3.8.1/envs/mypgadmin4/lib/python3.8/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/__init__.py

just need fix the line 1310:

columns.append(self.qtIdent(self.conn, c['attname']))

to

columns.append(self.qtIdent(self.conn, c['name']))

They changed the attribute name. That's why gives this error

Hope its helps

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .