Thanks Aditya, attached you can find the file __init__.py many thanks, Marco
Il giorno lun 5 ott 2020 alle ore 07:02 Aditya Toshniwal < aditya.toshni...@enterprisedb.com> ha scritto: > Hi Marco, > > Can you share the contents of file - /usr/lib/python3.8/site- > packages/pgadmin4-web/pgadmin/browser/server_groups/servers/ > databases/schemas/tables/row_security_policies/tests/__init__.py ? > There is no such select statement in the original source code. > > On Fri, Oct 2, 2020 at 10:29 PM Marco Azzalini <mark.azzal...@gmail.com> > wrote: > >> Hi, this is my first message here. >> Today my pgAdmin4 console doesn't start anymore... it takes lots of time >> and then a pop up appears complaining that pgAdmin server could not be >> contacted >> >> at the end of the log there is this error: >> >> * File >> "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/__init__.py", >> line 1* >> >> * SELECT rel.oid, rel.relname AS name,* >> >> * ^* >> >> *SyntaxError: invalid syntax* >> >> My system is Linux OpenSuse Tumbleweed and the pgAdmin version >> is 4.26-2.1 (the latest available for my system) >> Recently I got some updates for python subsystem... now I have Python >> 3.8.5 >> >> may be this be the source of the problem? >> How can I fix it? >> >> thanks in advance for any hint >> Marco >> >> Full log : >> ---------------------------------------- >> >> Traceback (most recent call last): >> >> File "/usr/lib/python3.8/site-packages/pgadmin4-web/pgAdmin4.py", line >> 93, in <module> app = create_app() >> >> File "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/__init__.py", >> line 618, in create_app app.register_blueprint(module) >> >> File "/usr/lib/python3.8/site-packages/flask/app.py", line 98, in >> wrapper_func return f(self, *args, **kwargs) >> >> File "/usr/lib/python3.8/site-packages/flask/app.py", line 1168, in >> register_blueprint blueprint.register(self, options, first_registration) >> >> File >> "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/utils/__init__.py", >> line 71, in register app.register_blueprint(module) >> >> File "/usr/lib/python3.8/site-packages/flask/app.py", line 98, in >> wrapper_func return f(self, *args, **kwargs) >> >> File "/usr/lib/python3.8/site-packages/flask/app.py", line 1168, in >> register_blueprint blueprint.register(self, options, first_registration) >> >> File >> "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/utils/__init__.py", >> line 71, in register app.register_blueprint(module) >> >> File "/usr/lib/python3.8/site-packages/flask/app.py", line 98, in >> wrapper_func return f(self, *args, **kwargs) >> >> File "/usr/lib/python3.8/site-packages/flask/app.py", line 1168, in >> register_blueprint blueprint.register(self, options, first_registration) >> >> File >> "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/browser/server_groups/servers/__init__.py", >> line 309, in register super(ServerModule, self).register(app, options, >> first_registration) >> >> File >> "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/utils/__init__.py", >> line 71, in register app.register_blueprint(module) >> >> File "/usr/lib/python3.8/site-packages/flask/app.py", line 98, in >> wrapper_func return f(self, *args, **kwargs) >> >> File "/usr/lib/python3.8/site-packages/flask/app.py", line 1168, in >> register_blueprint blueprint.register(self, options, first_registration) >> >> File >> "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/utils/__init__.py", >> line 71, in register app.register_blueprint(module) >> >> File "/usr/lib/python3.8/site-packages/flask/app.py", line 98, in >> wrapper_func return f(self, *args, **kwargs) >> >> File "/usr/lib/python3.8/site-packages/flask/app.py", line 1168, in >> register_blueprint blueprint.register(self, options, first_registration) >> >> File >> "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/utils/__init__.py", >> line 71, in register app.register_blueprint(module) >> >> File "/usr/lib/python3.8/site-packages/flask/app.py", line 98, in >> wrapper_func return f(self, *args, **kwargs) >> >> File "/usr/lib/python3.8/site-packages/flask/app.py", line 1168, in >> register_blueprint blueprint.register(self, options, first_registration) >> >> File >> "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/utils/__init__.py", >> line 71, in register app.register_blueprint(module) >> >> File "/usr/lib/python3.8/site-packages/flask/app.py", line 98, in >> wrapper_func return f(self, *args, **kwargs) >> >> File "/usr/lib/python3.8/site-packages/flask/app.py", line 1168, in >> register_blueprint blueprint.register(self, options, first_registration) >> >> File >> "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/utils/__init__.py", >> line 64, in register self.submodules = >> list(app.find_submodules(self.import_name)) >> >> File "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/__init__.py", >> line 67, in find_submodules module = import_module(module_name) >> >> File "/usr/lib64/python3.8/importlib/__init__.py", line 127, in >> import_module return _bootstrap._gcd_import(name[level:], package, level) >> >> File "<frozen importlib._bootstrap>", line 1014, in _gcd_import >> >> File "<frozen importlib._bootstrap>", line 991, in _find_and_load >> >> File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked >> >> File "<frozen importlib._bootstrap>", line 671, in _load_unlocked >> >> File "<frozen importlib._bootstrap_external>", line 779, in exec_module >> >> File "<frozen importlib._bootstrap_external>", line 916, in get_code >> >> File "<frozen importlib._bootstrap_external>", line 846, in source_to_code >> >> File "<frozen importlib._bootstrap>", line 219, in >> _call_with_frames_removed >> >> File >> "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/tests/__init__.py", >> line 1 >> >> SELECT rel.oid, rel.relname AS name, >> >> ^ >> >> SyntaxError: invalid syntax >> >> >> > > -- > Thanks, > Aditya Toshniwal > pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com* > <http://edbpostgres.com> > "Don't Complain about Heat, Plant a TREE" > -- https://ilmilione.org ---- Anche sogliono essere odiatissimi i buoni e i generosi perché ordinariamente sono sinceri, e chiamano le cose coi loro nomi. Colpa non perdonata dal genere umano, il quale non odia mai tanto chi fa male, né il male stesso, quanto chi lo nomina. - Leopardi -
SELECT rel.oid, rel.relname AS name, (SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid AND tgisinternal = FALSE) AS triggercount, (SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid AND tgisinternal = FALSE AND tgenabled = 'O') AS has_enable_triggers, pg_get_expr(rel.relpartbound, rel.oid) AS partition_value, rel.relnamespace AS schema_id, nsp.nspname AS schema_name, (CASE WHEN rel.relkind = 'p' THEN true ELSE false END) AS is_partitioned, (CASE WHEN rel.relkind = 'p' THEN true ELSE false END) AS is_sub_partitioned, (CASE WHEN rel.relkind = 'p' THEN pg_get_partkeydef(rel.oid::oid) ELSE '' END) AS partition_scheme, (CASE WHEN rel.relkind = 'p' THEN pg_get_partkeydef(rel.oid::oid) ELSE '' END) AS sub_partition_scheme, (CASE WHEN rel.relpersistence = 'u' THEN true ELSE false END) AS relpersistence, substring(array_to_string(rel.reloptions, ',') FROM 'fillfactor=([0-9]*)') AS fillfactor, (substring(array_to_string(rel.reloptions, ',') FROM 'autovacuum_enabled=([a-z|0-9]*)'))::BOOL AS autovacuum_enabled, substring(array_to_string(rel.reloptions, ',') FROM 'autovacuum_vacuum_threshold=([0-9]*)') AS autovacuum_vacuum_threshold, substring(array_to_string(rel.reloptions, ',') FROM 'autovacuum_vacuum_scale_factor=([0-9]*[.]?[0-9]*)') AS autovacuum_vacuum_scale_factor, substring(array_to_string(rel.reloptions, ',') FROM 'autovacuum_analyze_threshold=([0-9]*)') AS autovacuum_analyze_threshold, substring(array_to_string(rel.reloptions, ',') FROM 'autovacuum_analyze_scale_factor=([0-9]*[.]?[0-9]*)') AS autovacuum_analyze_scale_factor, substring(array_to_string(rel.reloptions, ',') FROM 'autovacuum_vacuum_cost_delay=([0-9]*)') AS autovacuum_vacuum_cost_delay, substring(array_to_string(rel.reloptions, ',') FROM 'autovacuum_vacuum_cost_limit=([0-9]*)') AS autovacuum_vacuum_cost_limit, substring(array_to_string(rel.reloptions, ',') FROM 'autovacuum_freeze_min_age=([0-9]*)') AS autovacuum_freeze_min_age, substring(array_to_string(rel.reloptions, ',') FROM 'autovacuum_freeze_max_age=([0-9]*)') AS autovacuum_freeze_max_age, substring(array_to_string(rel.reloptions, ',') FROM 'autovacuum_freeze_table_age=([0-9]*)') AS autovacuum_freeze_table_age, (substring(array_to_string(tst.reloptions, ',') FROM 'autovacuum_enabled=([a-z|0-9]*)'))::BOOL AS toast_autovacuum_enabled, substring(array_to_string(tst.reloptions, ',') FROM 'autovacuum_vacuum_threshold=([0-9]*)') AS toast_autovacuum_vacuum_threshold, substring(array_to_string(tst.reloptions, ',') FROM 'autovacuum_vacuum_scale_factor=([0-9]*[.]?[0-9]*)') AS toast_autovacuum_vacuum_scale_factor, substring(array_to_string(tst.reloptions, ',') FROM 'autovacuum_analyze_threshold=([0-9]*)') AS toast_autovacuum_analyze_threshold, substring(array_to_string(tst.reloptions, ',') FROM 'autovacuum_analyze_scale_factor=([0-9]*[.]?[0-9]*)') AS toast_autovacuum_analyze_scale_factor, substring(array_to_string(tst.reloptions, ',') FROM 'autovacuum_vacuum_cost_delay=([0-9]*)') AS toast_autovacuum_vacuum_cost_delay, substring(array_to_string(tst.reloptions, ',') FROM 'autovacuum_vacuum_cost_limit=([0-9]*)') AS toast_autovacuum_vacuum_cost_limit, substring(array_to_string(tst.reloptions, ',') FROM 'autovacuum_freeze_min_age=([0-9]*)') AS toast_autovacuum_freeze_min_age, substring(array_to_string(tst.reloptions, ',') FROM 'autovacuum_freeze_max_age=([0-9]*)') AS toast_autovacuum_freeze_max_age, substring(array_to_string(tst.reloptions, ',') FROM 'autovacuum_freeze_table_age=([0-9]*)') AS toast_autovacuum_freeze_table_age, rel.reloptions AS reloptions, tst.reloptions AS toast_reloptions, rel.reloftype, typ.typname, typ.typrelid AS typoid, des.description, pg_get_userbyid(rel.relowner) AS relowner FROM (SELECT * FROM pg_inherits WHERE inhparent = {{ tid }}::oid) inh LEFT JOIN pg_class rel ON inh.inhrelid = rel.oid LEFT JOIN pg_namespace nsp ON rel.relnamespace = nsp.oid LEFT OUTER JOIN pg_class tst ON tst.oid = rel.reltoastrelid LEFT OUTER JOIN pg_description des ON (des.objoid=rel.oid AND des.objsubid=0 AND des.classoid='pg_class'::regclass) LEFT JOIN pg_type typ ON rel.reloftype=typ.oid WHERE rel.relispartition {% if ptid %} AND rel.oid = {{ ptid }}::OID {% endif %} ORDER BY rel.relname;