Search code examples
postgresqlpgadminwindows-11

PostgreSQL unreadable/unknown error message


In terms of software development course I had to set up PostgreSQL on my laptop (Windows 11 x64). At pgAdmin on server creation (register) stage I reveived unreadable error message. I only managed myself is server name, host name, and password. Also if I change the username to some other it will placed instead of "postgres". Changing of pgAdmin interface language didn't helped. All the references are below

Also remind you that after I downloaded PostgreSQL (or pgAdmin) there is preset "PostgreSQL 16" server that has hostname=localhost and port=5432. If this server prevents me from creating a new one (with current settings), what do I need to change in the settings of the new server?

enter image description here enter image description here enter image description here


Solution

  • Firstly, the exception transcription says (possibly): "Unable to connect to server: connection failed::1), port 5432 failed: FATAL: password authentification failed for user 'postgres'"

    Given transctiption lost the after-username part of message, but it fits most from my point-of-view because fixing this error fixed my own error

    Solution: use the account password that is mentioned in the "username" line. If it is "postgres" (a.k.a. superuser), use password for superuser account. If it's some "other account" (e.g. "anothername" on second picture), use the password from "other account"


    Secondly, it possible to fix symbols encoding by changing machine language or using SQL Shell (psql). If the SQL Shell has broken encoding do next:

    1. Open regedit
    2. Go to \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor
    3. Create string parameter "Autorun"
    4. Put in it value "chcp some digits" (in my case "chcp 1251")

    That might possibly help with the SQL Shell encoding situation