Unable to connect to postgresql with pgAdmin4: readonly attribute error - postgresql

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

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.

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

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.

Related

DBeaver PostgreSQL Database - SCRAM authentication is not supported by this driver

I am trying to add a PostgreSQL database to DBeaver and am getting the following error when I try to connect to the database. I'm using DBeaver Version 7.2.3.202010191702. And after receiving this message I installed the latest version of the JDK (11.0.9) and pgJDBC (postgresql-42.2.18.jar). I've not had PostgreSQL on this machine yet, so it's a fresh install of the latest version (v13). Any suggestions?
SCRAM authentication is not supported by this driver. You need JDK >= 8 and pgjdbc >= 42.2.0 (not ".jre" vesions)
I had same error and in my situation I had old database drivers. These steps fixed it for me:
Go to Database Driver Manager
Select PostgreSQL (either double click or single select and then "Edit ...")
Click on "Download/Update"
Choose newer version (see bold version text) e.g. 42.2.18 for org.postgresql:postgresql:RELEASE
Press "Download"
Even using all the tips and tricks found on SO I was not able to connect to PGSQL 14 DBs.
I fixed it by using PostgreSQL (Old) driver, and it now works.
The problem I faced was identical, and what resolved it for me was:
Removing the previous PostgreSQL JDBC from the lib folder.
Downloading the latest PostgreSQL JDBC.
Substituting the old JDBC with the new one.
I had a problem similar to yours. This is the way to fix it:
open folder PostgreSQL\14\data, edit postgresql.config fix password_encryption to md5
alter all METHOD value to password in pg_hba.conf
restart postgres server
In my case, JRE version postgres being used in Pom.xml. Update it to the latest version and it should work

PostgreSQL, WAMP, Laravel 5.5 - "php artisan migrate" throwing "driver not found" exception

I'm getting the "Driver not found" PDO exception when trying to connect to PostgreSQL DB and I can't seem to figure out what's happening. Here are system specs:
WampServer Version 3.0.3 64bit
PHP 7.1.10
Apache 2.4.9
Laravel 5.5
I downloaded PosgtreSQL 10 (Windows x86-64) from here - EnterpriseDB
Here are all the relevant screenshots:
extension_loaded('pgsql')
returns true
The only discrepancy that I see is that I downloaded PostgreSQL 10, and PHP Info says PostgreSQL(libpq) Version is 9.6.2. Could that be an issue?
EDIT:
I replaced PostgreSQL 10 with 9.6.5 (which is the only available 9.6 version), and it didn't fix the issue.
EDIT 2:
$dbh = new PDO("pgsql:dbname=laravel_admin_api;host=127.0.0.1", "postgres", "admin");
echo $dbh ? "connected" : "failed";
returns connected. So it's gotta be a Laravel issue?
EDIT 3:
Ok, so the connection to the database works, I created a table and inserted a row manually through pgAdmin, and then called
\App\User::all()->toArray()
and that worked. So it's actually php artisan migrate that's having issues, and throwing the could not find driver exception. Still stumped on that one.
I was facing the same issue and I tried couple of solutions through the internet. None of those worked for me and finally I could get it to work by installing Apache 2.4 and php 7.2.7 separately instead of using Xamp or Wamp on windows. Sharing most important steps so that it might be helpful for anyone out there.
Install Apache as per https://www.sitepoint.com/how-to-install-apache-on-windows/. In my case I installed Apache 2.4
Install PHP as an Apache module - https://www.sitepoint.com/how-to-install-php-on-windows/ (I downloaded PHP thread safe version for Windows 64)
If you get both of above to work properly. Install Laravel in the htdocs and try php artisan migrate command.

unable to locate postgresql in etc centos

I tried installing postgresql in my server which has centos
I followed this link
I am facing few complexity here.
I could not locate postgresql file in /etc directory.
psql (8.4.13, server 9.2.4) WARNING: psql version 8.4, server version 9.2. Some psql features might not work.
How can i solve these issues. can anyone suggest me.
I could not locate postgresql file in /etc directory.
The tutorial you linked to suggests the config files are in /var/lib/pgsql/9.2/data/...
psql (8.4.13, server 9.2.4) WARNING: psql version 8.4, server version 9.2. Some psql features might not work.
You've still got the 8.4 version of psql installed. Use your package tools (rpm/yum) to see what versions of the psql client packages are installed and where the binaries are.
It's common enough to run two different versions of PG on the same machine. Obviously each needs its own data directory and port number. Also, as you've seen psql will check the version number and warn if they are different. Basic queries still work, but obviously an 8.4 version won't know about extensions introduced in 9.1 and that sort of thing.

How to fix pg_dump version mismatch errors?

When trying to get local data to Heroku, I am encountering a version mismatch between two different versions of pg_dump.
Specifically, I am getting this message:
pg_dump: server version: 9.2.2; pg_dump version: 9.1.4
pg_dump: aborting because of server version mismatch
I have found others with this problem, but do not know enough to implement the proposed solutions. (I am new to Ruby on Rails, PostgreSQL, Heroku, and the Mac! Very much at the stage of playing around the picking things up as I go.)
I was thinking I might simplify my life if I uninstalled all PostgreSQL on my local machine and started again with a clean install of PostgreSQL 9.2.2 from http://postgresapp.com/, but I don't know how to go about doing the uninstall.
I'm running Mac OS X Mountain Lion 10.8.2.
OS X 10.8 comes with pg_dump version 9.1.4 in the /usr/bin directory, along with psql and other programs that are client-side PostgreSQL tools. It does not mean that PostgreSQL as a server is installed (unless you have OS X Server Edition).
So you don't have to uninstall PostgreSQL because it's not installed and it's better not to remove these postgres client tools in /usr/bin because they belong to the system as shipped by Apple. They just need to be side-stepped.
The package provided by postgres.app comprises both the PostgreSQL server and the client-side tools of the same version as this server. These tools get installed in /Applications/Postgres.app/Contents/MacOS/bin
To use these instead of the 9.1 ones from Apple when you work in a Terminal, postgres.app documentation says to do:
PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"
and put it in your .profile file.
Once you have done that and you run pg_dump, you should no longer get the error that's it's the wrong version, because it would be the one that ships with postgres.app (currently 9.2.2).
I have this setup and it works OK for me.
If you only need to upgrade your pg_dump to the latest version and you have homebrew and mac, if the app has the latest version and your local pg doesn't:
brew upgrade postgresql
If you're using postgresapp 9.3.x, the path is different. The following worked for me (courtesy of http://sigmyers.com/blog/2013/3/12/postgres-pgdump-version-mismatch-error-postgresapp-postgresappcom)
export PG_BIN_PATH="/Applications/Postgres.app/Contents/Versions/9.3/bin/"
PATH=$PG_BIN_PATH:$PATH
Check here for the latest path: http://postgresapp.com/documentation/cli-tools.html
I'm running Mountain Lion Server. My PostgeSQL server is at version 9.2.1 and the default tools are at 9.1.5.
I had to use:
PATH="/Applications/Server.app/Contents/ServerRoot/usr/bin:$PATH"
to make it work.
Yep, sometimes if you run Postgres.app this may happen after upgrade. Make sure you restart your Postgres.app - it will update your PATH.
In my case I have postgresql installed via homebrew and the executables are here: /usr/local/opt/postgresql#9.6/bin
Or you copy the dump and restore executions to the /Applications/Postgres.app/Contents/SharedSupport folder
or in PdAgmin you point the PG bin Path (in properties -> binary Path) to the path of the executables of your postgre

No liblwgeom when using postgresql84 and postgis on Snow Leopard with MacPorts

I'm trying to get my dev environment back up and running after upgrading to Snow Leopard. In particular, I need postgresql and postgis working, but I'm running into the following problem.
After installing both with the following:
sudo port install postgresql84 postgresql84-server postgis
I get errors like the following when I try to load my sql database, which has references to liblwgeom.so
ERROR: function public.box3d_in(cstring) does not exist
ERROR: incompatible library "/usr/local/pgsql/lib/liblwgeom.so": version mismatch
DETAIL: Server is version 8.4, library is version 8.3.
That file does exist on my computer, but must be sitting around from an old install of postgresql 8.3. The problem is I can't figure out where liblwgeom.so is supposed to come from. It's not included in postgis 1.4, and a Google search is leaving me scratching my head. Any ideas?
liblwgeom.so comes with PostGIS vesion 1.3. It has been renamed in 1.4. It looks like your dump is of a database with PostGIS 1.3 and you're trying to reload in PostGIS 1.4. This is not supported.
See the PostGIS manual on upgrading for details on what to do.
Update your ports:
sudo port selfupdate
Then install postgis 1.4, which will work for postgresql 8.4
sudo port install postgis