but when I try to save the changes . an error pop out says "you don't have the permission to open this file ,see the owner of the file or an administrator to obtain permission"
even though I went to properties/security/mylaptopaccount and made it full control
Such gross changes should not be made to the registry. You changed the settings of the whole system for the needs of one console. This will affect many services and console applications. You need to find a shortcut in the start menu. "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\PostgreSQL 12\SQL Shell (psql).lnk" By the right click, select "Change" and add to the batch file an indication of the need to change the code page, save. Here is an example of a standard script:
@echo off chcp 1251 REM Copyright (c) 2012-2020, EnterpriseDB Corporation. All rights reserved REM PostgreSQL server psql runner script for Windows
SET server=localhost SET /P server="Server [%server%]: "
SET database=postgres SET /P database="Database [%database%]: "
SET port=5999 SET /P port="Port [%port%]: "
SET username=postgres SET /P username="Username [%username%]: "
for /f "delims=" %%a in ('chcp ^|find /c "932"') do @ SET CLIENTENCODING_JP=%%a if "%CLIENTENCODING_JP%"=="1" SET PGCLIENTENCODING=SJIS if "%CLIENTENCODING_JP%"=="1" SET /P PGCLIENTENCODING="Client Encoding [%PGCLIENTENCODING%]: "
REM Run psql "C:\Program Files\PostgreSQL\12\bin\psql.exe" -h %server% -U %username% -d %database% -p %port%
I have only the default protection that comes with the operating system
wow the postgres started working!! but the problem came back that talks about console code " WARNING: Console code page (437) differs from Windows code page (1252)
8-bit characters might not work correctly. See psql reference page "Notes for Windows users" for details.