pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
The postgres server don't work
14+ messages / 3 participants
[nested] [flat]

* The postgres server don't work
@ 2022-01-07 18:05 Mohammed falih <moh.falih98@gmail.com>
  2022-01-08 18:45 ` Re: The postgres server don't work Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 14+ messages in thread

From: Mohammed falih @ 2022-01-07 18:05 UTC (permalink / raw)
  To: pgsql-general

Hello Mr/Mrs
I hope you are fine and doing well
I have a problem with the postgres server
first my operating system is windows 10 pro
and my postgres version is 13
this problem i have tried to solve it for more than two weeks and nothing
changed
lastly I have formatted the laptop and downloaded only PostgreSQL program
and it worked well for less than a hour then its server broken
the error says in sql shell " could not connect to server: Connection
refused (0x0000274D/10061)
        Is the server running on host "localhost" (::1) and accepting
        TCP/IP connections on port 5432?"
I changed the port and nothing different
yes this problem is happening regularly but with me nothing solved it

I tried to go to configuration files (the pg_hba.conf ( I added a line in
the last
host all all 0.0.0.0/0 md5)
and in postgresql.conf file (the listening addresses was already to :"*")

also I when I try to start the server from service tab says
the postgres service cannot restart
it says that "some services stop automatically if they are not in use by
other services or programs
and when I check it in the event viewer there is an error says
 "FATAL: XX000: C:\Program Files\PostgreSQL\13\bin\postgres.exe: could not
locate matching postgres executable LOCATION: getInstallationPaths,
d:\pginstaller_13.auto\postgres.windows-x64\src\backend\postmaster\postmaster.c:1489"

and maybe you need to know that after I finish installing the postgre
program I haven't installed the stack builder and when I run the sql shell
for first time there were a problem says "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"
and I solved this problem by go to registry
editor/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/command processor
and there i have entered a new string value called Autorun and its value is
chcp 1252

I hope you’ll help me to fix this problem because I have many tasks I
couldn't do because the postgres problem

thank you for your efforts
my best regards

^ permalink  raw  reply  [nested|flat] 14+ messages in thread

* Re: The postgres server don't work
  2022-01-07 18:05 The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
@ 2022-01-08 18:45 ` Adrian Klaver <adrian.klaver@aklaver.com>
  2022-01-08 22:47   ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  0 siblings, 1 reply; 14+ messages in thread

From: Adrian Klaver @ 2022-01-08 18:45 UTC (permalink / raw)
  To: Mohammed falih <moh.falih98@gmail.com>; pgsql-general

On 1/7/22 10:05, Mohammed falih wrote:
> Hello Mr/Mrs
> I hope you are fine and doing well
> I have a problem with the postgres server
> first my operating system is windows 10 pro
> and my postgres version is 13
> this problem i have tried to solve it for more than two weeks and 
> nothing changed
> lastly I have formatted the laptop and downloaded only PostgreSQL 
> program and it worked well for less than a hour then its server broken

Questions and comments inline below.

Define broken?

In other words what does the Postgres log show in the period from when 
it ran to when it did not?

> the error says in sql shell " could not connect to server: Connection 
> refused (0x0000274D/10061)
>          Is the server running on host "localhost" (::1) and accepting
>          TCP/IP connections on port 5432?"
> I changed the port and nothing different
> yes this problem is happening regularly but with me nothing solved it

The issue is the below where it could not find the executable. Are you 
starting the service as an administrator?

> 
> I tried to go to configuration files (the pg_hba.conf ( I added a line 
> in the last
> host all all 0.0.0.0/0 <http://0.0.0.0/0; md5)
> and in postgresql.conf file (the listening addresses was already to :"*")
> 
> also I when I try to start the server from service tab says
> the postgres service cannot restart
> it says that "some services stop automatically if they are not in use by 
> other services or programs
> and when I check it in the event viewer there is an error says
>   "FATAL: XX000: C:\Program Files\PostgreSQL\13\bin\postgres.exe: could 
> not locate matching postgres executable LOCATION: getInstallationPaths, 
> d:\pginstaller_13.auto\postgres.windows-x64\src\backend\postmaster\postmaster.c:1489"

Does this path C:\Program Files\PostgreSQL\13\bin\postgres.exe actually 
exist?

> 
> and maybe you need to know that after I finish installing the postgre 
> program I haven't installed the stack builder and when I run the sql 
> shell for first time there were a problem says "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"

This has to do with the psql client not the server.

> and I solved this problem by go to registry 
> editor/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/command processor
> and there i have entered a new string value called Autorun and its value 
> is chcp 1252
> 
> I hope you’ll help me to fix this problem because I have many tasks I 
> couldn't do because the postgres problem
> 
> thank you for your efforts
> my best regards
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





^ permalink  raw  reply  [nested|flat] 14+ messages in thread

* Re: The postgres server don't work
  2022-01-07 18:05 The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-08 18:45 ` Re: The postgres server don't work Adrian Klaver <adrian.klaver@aklaver.com>
@ 2022-01-08 22:47   ` Mohammed falih <moh.falih98@gmail.com>
  2022-01-08 23:18     ` Re: The postgres server don't work Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 14+ messages in thread

From: Mohammed falih @ 2022-01-08 22:47 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-general

I mean by broken that when I run psql shell or padding I receive this error
" " could not connect to server: Connection
refused (0x0000274D/10061)
 Is the server running on host "localhost" (::1) and accepting
      TCP/IP connections on port 5432?"

and about the log file , usually this problem happens after my laptop
turned off or restart
so last line in the log file is "database system is shut down"
and no matter how many times I tried by restart the laptop nothing  changes

the ex files are all in their right location , and I tried both ways in
regular running and as administrator and nothing different

yes the postgres.exe is exist there

and about the console code problem ,yes maybe this error is related to the
client but I realized that after I make this solution and make  restart to
the laptop , the postgres begins to not working ,maybe this was a
coincidence I don't know

thank you for your efforts
On Sat, 8 Jan 2022, 9:45 pm Adrian Klaver, <adrian.klaver@aklaver.com>
wrote:

> On 1/7/22 10:05, Mohammed falih wrote:
> > Hello Mr/Mrs
> > I hope you are fine and doing well
> > I have a problem with the postgres server
> > first my operating system is windows 10 pro
> > and my postgres version is 13
> > this problem i have tried to solve it for more than two weeks and
> > nothing changed
> > lastly I have formatted the laptop and downloaded only PostgreSQL
> > program and it worked well for less than a hour then its server broken
>
> Questions and comments inline below.
>
> Define broken?
>
> In other words what does the Postgres log show in the period from when
> it ran to when it did not?
>
> > the error says in sql shell " could not connect to server: Connection
> > refused (0x0000274D/10061)
> >          Is the server running on host "localhost" (::1) and accepting
> >          TCP/IP connections on port 5432?"
> > I changed the port and nothing different
> > yes this problem is happening regularly but with me nothing solved it
>
> The issue is the below where it could not find the executable. Are you
> starting the service as an administrator?
>
> >
> > I tried to go to configuration files (the pg_hba.conf ( I added a line
> > in the last
> > host all all 0.0.0.0/0 <http://0.0.0.0/0; md5)
> > and in postgresql.conf file (the listening addresses was already to :"*")
> >
> > also I when I try to start the server from service tab says
> > the postgres service cannot restart
> > it says that "some services stop automatically if they are not in use by
> > other services or programs
> > and when I check it in the event viewer there is an error says
> >   "FATAL: XX000: C:\Program Files\PostgreSQL\13\bin\postgres.exe: could
> > not locate matching postgres executable LOCATION: getInstallationPaths,
> >
> d:\pginstaller_13.auto\postgres.windows-x64\src\backend\postmaster\postmaster.c:1489"
>
> Does this path C:\Program Files\PostgreSQL\13\bin\postgres.exe actually
> exist?
>
> >
> > and maybe you need to know that after I finish installing the postgre
> > program I haven't installed the stack builder and when I run the sql
> > shell for first time there were a problem says "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"
>
> This has to do with the psql client not the server.
>
> > and I solved this problem by go to registry
> > editor/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/command processor
> > and there i have entered a new string value called Autorun and its value
> > is chcp 1252
> >
> > I hope you’ll help me to fix this problem because I have many tasks I
> > couldn't do because the postgres problem
> >
> > thank you for your efforts
> > my best regards
> >
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
>

^ permalink  raw  reply  [nested|flat] 14+ messages in thread

* Re: The postgres server don't work
  2022-01-07 18:05 The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-08 18:45 ` Re: The postgres server don't work Adrian Klaver <adrian.klaver@aklaver.com>
  2022-01-08 22:47   ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
@ 2022-01-08 23:18     ` Adrian Klaver <adrian.klaver@aklaver.com>
  2022-01-08 23:29       ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  0 siblings, 1 reply; 14+ messages in thread

From: Adrian Klaver @ 2022-01-08 23:18 UTC (permalink / raw)
  To: Mohammed falih <moh.falih98@gmail.com>; +Cc: pgsql-general

On 1/8/22 14:47, Mohammed falih wrote:
> I mean by broken that when I run psql shell or padding I receive this 
> error " " could not connect to server: Connection
> refused (0x0000274D/10061)
>   Is the server running on host "localhost" (::1) and accepting
>        TCP/IP connections on port 5432?"
> 
> and about the log file , usually this problem happens after my laptop 
> turned off or restart
> so last line in the log file is "database system is shut down"
> and no matter how many times I tried by restart the laptop nothing  changes

I am not following '...usually this problem happens after my laptop 
turned off or restart...'. This would seem to imply that the service 
does start sometimes. Is that the case?

> 
> the ex files are all in their right location , and I tried both ways in 
> regular running and as administrator and nothing different
> 
> yes the postgres.exe is exist there

Do you have an Anti-Virus program running on this machine?

> 
> and about the console code problem ,yes maybe this error is related to 
> the client but I realized that after I make this solution and make  
> restart to the laptop , the postgres begins to not working ,maybe this 
> was a coincidence I don't know

Then undo the changes and see what happens? I sort of doubt it is the 
issue though.

> 
> thank you for your efforts
> On Sat, 8 Jan 2022, 9:45 pm Adrian Klaver, <adrian.klaver@aklaver.com 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





^ permalink  raw  reply  [nested|flat] 14+ messages in thread

* Re: The postgres server don't work
  2022-01-07 18:05 The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-08 18:45 ` Re: The postgres server don't work Adrian Klaver <adrian.klaver@aklaver.com>
  2022-01-08 22:47   ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-08 23:18     ` Re: The postgres server don't work Adrian Klaver <adrian.klaver@aklaver.com>
@ 2022-01-08 23:29       ` Mohammed falih <moh.falih98@gmail.com>
  2022-01-08 23:40         ` Re: The postgres server don't work Adrian Klaver <adrian.klaver@aklaver.com>
  2022-01-08 23:51         ` Re: The postgres server don't work Adrian Klaver <adrian.klaver@aklaver.com>
  2022-01-09 04:18         ` Re: The postgres server don't work Дмитрий Иванов <firstdismay@gmail.com>
  0 siblings, 3 replies; 14+ messages in thread

From: Mohammed falih @ 2022-01-08 23:29 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-general

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."


On Sun, 9 Jan 2022, 2:18 am Adrian Klaver, <adrian.klaver@aklaver.com>
wrote:

> On 1/8/22 14:47, Mohammed falih wrote:
> > I mean by broken that when I run psql shell or padding I receive this
> > error " " could not connect to server: Connection
> > refused (0x0000274D/10061)
> >   Is the server running on host "localhost" (::1) and accepting
> >        TCP/IP connections on port 5432?"
> >
> > and about the log file , usually this problem happens after my laptop
> > turned off or restart
> > so last line in the log file is "database system is shut down"
> > and no matter how many times I tried by restart the laptop nothing
> changes
>
> I am not following '...usually this problem happens after my laptop
> turned off or restart...'. This would seem to imply that the service
> does start sometimes. Is that the case?
>
> >
> > the ex files are all in their right location , and I tried both ways in
> > regular running and as administrator and nothing different
> >
> > yes the postgres.exe is exist there
>
> Do you have an Anti-Virus program running on this machine?
>
> >
> > and about the console code problem ,yes maybe this error is related to
> > the client but I realized that after I make this solution and make
> > restart to the laptop , the postgres begins to not working ,maybe this
> > was a coincidence I don't know
>
> Then undo the changes and see what happens? I sort of doubt it is the
> issue though.
>
> >
> > thank you for your efforts
> > On Sat, 8 Jan 2022, 9:45 pm Adrian Klaver, <adrian.klaver@aklaver.com
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
>

^ permalink  raw  reply  [nested|flat] 14+ messages in thread

* Re: The postgres server don't work
  2022-01-07 18:05 The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-08 18:45 ` Re: The postgres server don't work Adrian Klaver <adrian.klaver@aklaver.com>
  2022-01-08 22:47   ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-08 23:18     ` Re: The postgres server don't work Adrian Klaver <adrian.klaver@aklaver.com>
  2022-01-08 23:29       ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
@ 2022-01-08 23:40         ` Adrian Klaver <adrian.klaver@aklaver.com>
  2022-01-09 10:27           ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2 siblings, 1 reply; 14+ messages in thread

From: Adrian Klaver @ 2022-01-08 23:40 UTC (permalink / raw)
  To: Mohammed falih <moh.falih98@gmail.com>; +Cc: pgsql-general

On 1/8/22 15:29, Mohammed falih wrote:
> yes I think the service doesn't even start

Yet below you said it does.

> 
> I have only the default protection that comes with the operating system
> 
> wow the postgres started working!! but the problem came back that talks

Did you revert the change you made earlier to get it to work?


> about console code " WARNING: Console code page (437) differs from 
> Windows code page (1252)
> 
> 8-bit characters mightnot  work correctly. See psql reference
>           page "Notes for Windows users"for  details."
> 

So follow the instructions here :

https://www.postgresql.org/docs/current/app-psql.html

"
Notes for Windows Users

psql is built as a “console application”. Since the Windows console 
windows use a different encoding than the rest of the system, you must 
take special care when using 8-bit characters within psql. If psql 
detects a problematic console code page, it will warn you at startup. To 
change the console code page, two things are necessary:

     Set the code page by entering cmd.exe /c chcp 1252. (1252 is a code 
page that is appropriate for German; replace it with your value.) If you 
are using Cygwin, you can put this command in /etc/profile.

     Set the console font to Lucida Console, because the raster font 
does not work with the ANSI code page.
"

In the terminal before running psql do:

cmd.exe /c chcp 1252



-- 
Adrian Klaver
adrian.klaver@aklaver.com





^ permalink  raw  reply  [nested|flat] 14+ messages in thread

* Re: The postgres server don't work
  2022-01-07 18:05 The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-08 18:45 ` Re: The postgres server don't work Adrian Klaver <adrian.klaver@aklaver.com>
  2022-01-08 22:47   ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-08 23:18     ` Re: The postgres server don't work Adrian Klaver <adrian.klaver@aklaver.com>
  2022-01-08 23:29       ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-08 23:40         ` Re: The postgres server don't work Adrian Klaver <adrian.klaver@aklaver.com>
@ 2022-01-09 10:27           ` Mohammed falih <moh.falih98@gmail.com>
  0 siblings, 0 replies; 14+ messages in thread

From: Mohammed falih @ 2022-01-09 10:27 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-general

yes sorry I wrote this sentence before try the solution you offered

yes by deleting the changes (the Autorun)

and thank you so much for your efforts ,I  have gone through this solution
before but didn't help me to solve the problem ,when I  go to command
prompt as administrator and insert chcp 1252 the command says 1252 is
activated
 and changed the font from the properties/font then click apply then open
the sql shell the error still there even though the font look looks
different than before

On Sun, 9 Jan 2022, 2:40 am Adrian Klaver, <adrian.klaver@aklaver.com>
wrote:

> On 1/8/22 15:29, Mohammed falih wrote:
> > yes I think the service doesn't even start
>
> Yet below you said it does.
>
> >
> > I have only the default protection that comes with the operating system
> >
> > wow the postgres started working!! but the problem came back that talks
>
> Did you revert the change you made earlier to get it to work?
>
>
> > about console code " WARNING: Console code page (437) differs from
> > Windows code page (1252)
> >
> > 8-bit characters mightnot  work correctly. See psql reference
> >           page "Notes for Windows users"for  details."
> >
>
> So follow the instructions here :
>
> https://www.postgresql.org/docs/current/app-psql.html
>
> "
> Notes for Windows Users
>
> psql is built as a “console application”. Since the Windows console
> windows use a different encoding than the rest of the system, you must
> take special care when using 8-bit characters within psql. If psql
> detects a problematic console code page, it will warn you at startup. To
> change the console code page, two things are necessary:
>
>      Set the code page by entering cmd.exe /c chcp 1252. (1252 is a code
> page that is appropriate for German; replace it with your value.) If you
> are using Cygwin, you can put this command in /etc/profile.
>
>      Set the console font to Lucida Console, because the raster font
> does not work with the ANSI code page.
> "
>
> In the terminal before running psql do:
>
> cmd.exe /c chcp 1252
>
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
>

^ permalink  raw  reply  [nested|flat] 14+ messages in thread

* Re: The postgres server don't work
  2022-01-07 18:05 The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-08 18:45 ` Re: The postgres server don't work Adrian Klaver <adrian.klaver@aklaver.com>
  2022-01-08 22:47   ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-08 23:18     ` Re: The postgres server don't work Adrian Klaver <adrian.klaver@aklaver.com>
  2022-01-08 23:29       ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
@ 2022-01-08 23:51         ` Adrian Klaver <adrian.klaver@aklaver.com>
  2022-01-09 10:30           ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2 siblings, 1 reply; 14+ messages in thread

From: Adrian Klaver @ 2022-01-08 23:51 UTC (permalink / raw)
  To: Mohammed falih <moh.falih98@gmail.com>; +Cc: pgsql-general

On 1/8/22 15:29, Mohammed falih wrote:
> 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 mightnot  work correctly. See psql reference
>           page "Notes for Windows users"for  details."
> 

I don't use Windows anymore so I am going from memory here. In the 
Windows menu there should be an entry for Postgres and its sub-programs. 
One of those should be named something like psql or database shell. 
Click on that, it will run a shell script that prompts you for 
connection information and if I remember correctly also takes care of 
the above issue.


-- 
Adrian Klaver
adrian.klaver@aklaver.com





^ permalink  raw  reply  [nested|flat] 14+ messages in thread

* Re: The postgres server don't work
  2022-01-07 18:05 The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-08 18:45 ` Re: The postgres server don't work Adrian Klaver <adrian.klaver@aklaver.com>
  2022-01-08 22:47   ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-08 23:18     ` Re: The postgres server don't work Adrian Klaver <adrian.klaver@aklaver.com>
  2022-01-08 23:29       ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-08 23:51         ` Re: The postgres server don't work Adrian Klaver <adrian.klaver@aklaver.com>
@ 2022-01-09 10:30           ` Mohammed falih <moh.falih98@gmail.com>
  0 siblings, 0 replies; 14+ messages in thread

From: Mohammed falih @ 2022-01-09 10:30 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-general

yes exactly  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/myaccount and made it full
control

On Sun, 9 Jan 2022, 2:51 am Adrian Klaver, <adrian.klaver@aklaver.com>
wrote:

> On 1/8/22 15:29, Mohammed falih wrote:
> > 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 mightnot  work correctly. See psql reference
> >           page "Notes for Windows users"for  details."
> >
>
> I don't use Windows anymore so I am going from memory here. In the
> Windows menu there should be an entry for Postgres and its sub-programs.
> One of those should be named something like psql or database shell.
> Click on that, it will run a shell script that prompts you for
> connection information and if I remember correctly also takes care of
> the above issue.
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
>

^ permalink  raw  reply  [nested|flat] 14+ messages in thread

* Re: The postgres server don't work
  2022-01-07 18:05 The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-08 18:45 ` Re: The postgres server don't work Adrian Klaver <adrian.klaver@aklaver.com>
  2022-01-08 22:47   ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-08 23:18     ` Re: The postgres server don't work Adrian Klaver <adrian.klaver@aklaver.com>
  2022-01-08 23:29       ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
@ 2022-01-09 04:18         ` Дмитрий Иванов <firstdismay@gmail.com>
  2022-01-09 10:16           ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2 siblings, 1 reply; 14+ messages in thread

From: Дмитрий Иванов @ 2022-01-09 04:18 UTC (permalink / raw)
  To: Mohammed falih <moh.falih98@gmail.com>; +Cc: Adrian Klaver <adrian.klaver@aklaver.com>; 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.
>
>

^ permalink  raw  reply  [nested|flat] 14+ messages in thread

* Re: The postgres server don't work
  2022-01-07 18:05 The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-08 18:45 ` Re: The postgres server don't work Adrian Klaver <adrian.klaver@aklaver.com>
  2022-01-08 22:47   ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-08 23:18     ` Re: The postgres server don't work Adrian Klaver <adrian.klaver@aklaver.com>
  2022-01-08 23:29       ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-09 04:18         ` Re: The postgres server don't work Дмитрий Иванов <firstdismay@gmail.com>
@ 2022-01-09 10:16           ` Mohammed falih <moh.falih98@gmail.com>
  2022-01-09 12:51             ` Re: The postgres server don't work Дмитрий Иванов <firstdismay@gmail.com>
  0 siblings, 1 reply; 14+ messages in thread

From: Mohammed falih @ 2022-01-09 10:16 UTC (permalink / raw)
  To: Дмитрий Иванов <firstdismay@gmail.com>; +Cc: Adrian Klaver <adrian.klaver@aklaver.com>; 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.
>>
>>

^ permalink  raw  reply  [nested|flat] 14+ messages in thread

* Re: The postgres server don't work
  2022-01-07 18:05 The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-08 18:45 ` Re: The postgres server don't work Adrian Klaver <adrian.klaver@aklaver.com>
  2022-01-08 22:47   ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-08 23:18     ` Re: The postgres server don't work Adrian Klaver <adrian.klaver@aklaver.com>
  2022-01-08 23:29       ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-09 04:18         ` Re: The postgres server don't work Дмитрий Иванов <firstdismay@gmail.com>
  2022-01-09 10:16           ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
@ 2022-01-09 12:51             ` Дмитрий Иванов <firstdismay@gmail.com>
  2022-01-09 13:42               ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  0 siblings, 1 reply; 14+ messages in thread

From: Дмитрий Иванов @ 2022-01-09 12:51 UTC (permalink / raw)
  To: Mohammed falih <moh.falih98@gmail.com>; +Cc: Adrian Klaver <adrian.klaver@aklaver.com>; pgsql-general

You need to open the folder containing the file and (you must be an
administrator)
 Open the file in an editor running as an administrator.
OR
Right click on the file "C:\Program
Files\PostgreSQL\12\scripts\runpsql.bat" -> Properties-> Security. Select
the "Users" group, click "Change" and give write access, click apply.
Starting with Windows 10, the "Program Files" folder is not writable for
regular users and administrators, not in administrator mode.
If all this is difficult for you, just copy the file to your desktop, edit
and run, it will be the same.
--
Regards, Dmitry!


вс, 9 янв. 2022 г. в 15:16, Mohammed falih <moh.falih98@gmail.com>:

> 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
>
>
>

^ permalink  raw  reply  [nested|flat] 14+ messages in thread

* Re: The postgres server don't work
  2022-01-07 18:05 The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-08 18:45 ` Re: The postgres server don't work Adrian Klaver <adrian.klaver@aklaver.com>
  2022-01-08 22:47   ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-08 23:18     ` Re: The postgres server don't work Adrian Klaver <adrian.klaver@aklaver.com>
  2022-01-08 23:29       ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-09 04:18         ` Re: The postgres server don't work Дмитрий Иванов <firstdismay@gmail.com>
  2022-01-09 10:16           ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-09 12:51             ` Re: The postgres server don't work Дмитрий Иванов <firstdismay@gmail.com>
@ 2022-01-09 13:42               ` Mohammed falih <moh.falih98@gmail.com>
  2022-01-09 13:47                 ` Re: The postgres server don't work Дмитрий Иванов <firstdismay@gmail.com>
  0 siblings, 1 reply; 14+ messages in thread

From: Mohammed falih @ 2022-01-09 13:42 UTC (permalink / raw)
  To: Дмитрий Иванов <firstdismay@gmail.com>; +Cc: Adrian Klaver <adrian.klaver@aklaver.com>; pgsql-general

It worked !
thank you so much , all of you
for your efforts and time
best wishes to you

On Sun, 9 Jan 2022, 3:51 pm Дмитрий Иванов, <firstdismay@gmail.com> wrote:

> You need to open the folder containing the file and (you must be an
> administrator)
>  Open the file in an editor running as an administrator.
> OR
> Right click on the file "C:\Program
> Files\PostgreSQL\12\scripts\runpsql.bat" -> Properties-> Security. Select
> the "Users" group, click "Change" and give write access, click apply.
> Starting with Windows 10, the "Program Files" folder is not writable for
> regular users and administrators, not in administrator mode.
> If all this is difficult for you, just copy the file to your desktop, edit
> and run, it will be the same.
> --
> Regards, Dmitry!
>
>
> вс, 9 янв. 2022 г. в 15:16, Mohammed falih <moh.falih98@gmail.com>:
>
>> 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
>>
>>
>>

^ permalink  raw  reply  [nested|flat] 14+ messages in thread

* Re: The postgres server don't work
  2022-01-07 18:05 The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-08 18:45 ` Re: The postgres server don't work Adrian Klaver <adrian.klaver@aklaver.com>
  2022-01-08 22:47   ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-08 23:18     ` Re: The postgres server don't work Adrian Klaver <adrian.klaver@aklaver.com>
  2022-01-08 23:29       ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-09 04:18         ` Re: The postgres server don't work Дмитрий Иванов <firstdismay@gmail.com>
  2022-01-09 10:16           ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
  2022-01-09 12:51             ` Re: The postgres server don't work Дмитрий Иванов <firstdismay@gmail.com>
  2022-01-09 13:42               ` Re: The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
@ 2022-01-09 13:47                 ` Дмитрий Иванов <firstdismay@gmail.com>
  0 siblings, 0 replies; 14+ messages in thread

From: Дмитрий Иванов @ 2022-01-09 13:47 UTC (permalink / raw)
  To: Mohammed falih <moh.falih98@gmail.com>; +Cc: Adrian Klaver <adrian.klaver@aklaver.com>; pgsql-general

Рад слышать это!
--
С уважением, Дмитрий!


вс, 9 янв. 2022 г. в 18:42, Mohammed falih <moh.falih98@gmail.com>:

> It worked !
> thank you so much , all of you
> for your efforts and time
> best wishes to you
>
> On Sun, 9 Jan 2022, 3:51 pm Дмитрий Иванов, <firstdismay@gmail.com> wrote:
>
>> You need to open the folder containing the file and (you must be an
>> administrator)
>>  Open the file in an editor running as an administrator.
>> OR
>> Right click on the file "C:\Program
>> Files\PostgreSQL\12\scripts\runpsql.bat" -> Properties-> Security. Select
>> the "Users" group, click "Change" and give write access, click apply.
>> Starting with Windows 10, the "Program Files" folder is not writable for
>> regular users and administrators, not in administrator mode.
>> If all this is difficult for you, just copy the file to your desktop,
>> edit and run, it will be the same.
>> --
>> Regards, Dmitry!
>>
>>
>> вс, 9 янв. 2022 г. в 15:16, Mohammed falih <moh.falih98@gmail.com>:
>>
>>> 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
>>>
>>>
>>>

^ permalink  raw  reply  [nested|flat] 14+ messages in thread


end of thread, other threads:[~2022-01-09 13:47 UTC | newest]

Thread overview: 14+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-01-07 18:05 The postgres server don't work Mohammed falih <moh.falih98@gmail.com>
2022-01-08 18:45 ` Adrian Klaver <adrian.klaver@aklaver.com>
2022-01-08 22:47   ` Mohammed falih <moh.falih98@gmail.com>
2022-01-08 23:18     ` Adrian Klaver <adrian.klaver@aklaver.com>
2022-01-08 23:29       ` Mohammed falih <moh.falih98@gmail.com>
2022-01-08 23:40         ` Adrian Klaver <adrian.klaver@aklaver.com>
2022-01-09 10:27           ` Mohammed falih <moh.falih98@gmail.com>
2022-01-08 23:51         ` Adrian Klaver <adrian.klaver@aklaver.com>
2022-01-09 10:30           ` Mohammed falih <moh.falih98@gmail.com>
2022-01-09 04:18         ` Дмитрий Иванов <firstdismay@gmail.com>
2022-01-09 10:16           ` Mohammed falih <moh.falih98@gmail.com>
2022-01-09 12:51             ` Дмитрий Иванов <firstdismay@gmail.com>
2022-01-09 13:42               ` Mohammed falih <moh.falih98@gmail.com>
2022-01-09 13:47                 ` Дмитрий Иванов <firstdismay@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox