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

From Дмитрий Иванов
Subject Re: The postgres server don't work
Date
Msg-id CAPL5KHqdY4oFtaEWtNJZTmr0VY1vcDBzh_MfZsYc-yWuuiTOXQ@mail.gmail.com
Whole thread Raw
In response to Re: The postgres server don't work  (Mohammed falih <moh.falih98@gmail.com>)
Responses Re: The postgres server don't work  (Mohammed falih <moh.falih98@gmail.com>)
List pgsql-general
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: Alicja Kucharczyk
Date:
Subject: Re: create database hangs forever on WSL - autovacuum deadlock?
Next
From: Mohammed falih
Date:
Subject: Re: The postgres server don't work