Re: Postgres service stops when I kill client backend on Windows

Поиск
Список
Период
Сортировка
От Charles Clavadetscher
Тема Re: Postgres service stops when I kill client backend on Windows
Дата
Msg-id 029501d1027b$36d61dd0$a4825970$@swisspug.org
обсуждение исходный текст
Ответ на Postgres service stops when I kill client backend on Windows  (Dmitry Vasilyev <d.vasilyev@postgrespro.ru>)
Ответы Re: Postgres service stops when I kill client backend on Windows  (Dmitry Vasilyev <d.vasilyev@postgrespro.ru>)
Список pgsql-hackers
Hello Dmitry

> -----Original Message-----
> From: pgsql-hackers-owner@postgresql.org [mailto:pgsql-hackers-owner@postgresql.org] On Behalf Of Dmitry Vasilyev
> Sent: Freitag, 9. Oktober 2015 11:52
> To: pgsql-hackers@postgresql.org
> Subject: [HACKERS] Postgres service stops when I kill client backend on Windows
>
> I’ve started PostgreSQL server on Windows and then I kill client
> backend’s process by taskkill the service was stopped:
>
> postgres=# select pg_backend_pid();
>  pg_backend_pid
> ----------------
>            1976
>
> postgres=# \! taskkill /pid 1976 /f
> SUCCESS: The process with PID 1976 has been terminated.
> postgres=# select 1;
> server closed the connection unexpectedly
>         This probably means the server terminated abnormally
>         before or while processing the request.
> The connection to the server was lost. Attempting reset: Failed.
> !>
>
>
> If I kill backend’s process on Linux then service not failing. So
> what’s the problem? Why PostgreSQL is so strange on Windows?

I can't say what happens on windows, but I don't undestand either why you want to kill the session you are in.
Besides that why don't you use pg_terminate_backend?

db=> select pg_backend_pid();pg_backend_pid
----------------          8808
(1 row)

db=> select pg_terminate_backend(8808);
FATAL:  terminating connection due to administrator command
server closed the connection unexpectedly       This probably means the server terminated abnormally       before or
whileprocessing the request. 
The connection to the server was lost. Attempting reset: Succeeded.
db=> select pg_backend_pid();pg_backend_pid
----------------          8500
(1 row)

Regards
Charles

>
>
> ------
> Dmitry Vasilyev
> Postgres Professional: http://www.postgrespro.com
> The Russian Postgres Company
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Etsuro Fujita
Дата:
Сообщение: Re: Foreign join pushdown vs EvalPlanQual
Следующее
От: Dmitry Vasilyev
Дата:
Сообщение: Re: Postgres service stops when I kill client backend on Windows