Re: The postgres server don't work - Mailing list pgsql-general

From Mohammed falih
Subject Re: The postgres server don't work
Date
Msg-id CADqaUh_Kz1wjGN=spZaQ3mw4Vtq=VU86TYBr6tS_0wq2w5ofew@mail.gmail.com
Whole thread Raw
In response to Re: The postgres server don't work  (Дмитрий Иванов <firstdismay@gmail.com>)
Responses Re: The postgres server don't work  (Дмитрий Иванов <firstdismay@gmail.com>)
List pgsql-general
thank you for your efforts 
I added chcp 1252 line 
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 

On Sun, 9 Jan 2022, 7:18 am Дмитрий Иванов, <firstdismay@gmail.com> wrote:
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%

pause

--
Regards, Dmitry!


вс, 9 янв. 2022 г. в 05:19, Mohammed falih <moh.falih98@gmail.com>:
yes I think the service doesn't even start 

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.

pgsql-general by date:

Previous
From: Дмитрий Иванов
Date:
Subject: Re: The postgres server don't work
Next
From: Mohammed falih
Date:
Subject: Re: The postgres server don't work