简体   繁体   中英

Unable to connect to postgresql with pgAdmin4: readonly attribute error

I have a local postgresql 10 server (tested the same on 9.6, don't think it's related to the DB at all, only to pgAdmin4, as pgAdmin3 works just fine)

As in the screenshot, I am trying to connect to the localhost db with user postgres on a fresh installation, but I keep receiving this message:

readonly attribute

I searched everywhere for this error, but couldn't find any useful solutions or workarounds 在此输入图像描述

This error is related to psycopg2. Please verify the version of psycopg2 installed on your system and update it to at least version 2.7.

At version 2.7 psycopg2 connection class the notices attribute is writable. On earlier versions it is a read only attribute.

If you comment the code in line 313 of /usr/share/pgadmin4/web/pgadmin/utils/driver/psycopg2/connection.py you could check it out.

#pg_conn.notices = deque([], self.ASYNC_NOTICE_MAXLENGTH)

You can try using pgAdmin4 wheel file, you will not face any such issues of an older version of packages from the native repo.

https://askubuntu.com/questions/831262/how-to-install-pgadmin-4-in-desktop-mode-on-ubuntu

pg4Admin 4 now is working for me. I got an update of python-psycopg2 to 2.7.4-1.pgdg16.04+1 amd64 version on my KDE Neon, that solved, to me, the readonly attribute problem.

I am on Ubuntu 16.04, but using postgresql and pgAdmin from apt.postgresql.org. I struck this bug. But the new version of psycopg2 that came through with the latest apt update solved the problem for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM