Re: The postgres server don't work

From: Дмитрий Иванов <firstdismay(at)gmail(dot)com>
To: Mohammed falih <moh(dot)falih98(at)gmail(dot)com>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: The postgres server don't work
Date: 2022-01-09 04:18:22
Message-ID: CAPL5KHqdY4oFtaEWtNJZTmr0VY1vcDBzh_MfZsYc-yWuuiTOXQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)falih98(at)gmail(dot)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.
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mohammed falih 2022-01-09 10:16:01 Re: The postgres server don't work
Previous Message Alicja Kucharczyk 2022-01-09 01:15:03 Re: create database hangs forever on WSL - autovacuum deadlock?