# Служба не запускается

<figure><img src="/files/7L4ZBOMp1CS4UuXtGseP" alt=""><figcaption></figcaption></figure>

Проблема связана с тем, что сервер запускается и намертво виснет на одной из транзакций, а Windows не получает сигнала об успешном запуске. Чаще всего такое бывает после некорректного завершения работы сервера или внеплановой перезагрузки (например, после отключения электроэнергии)

Порядок решения:

<figure><img src="/files/qIv0zbxsWUclgzqzOKQO" alt=""><figcaption></figcaption></figure>

```
// указываем пути к папкам с исполняемыми файлами:

set PGDATA=C:\Program Files\PostgreSQL\14.4-1.1C\data\

cd C:\Program Files\PostgreSQL\14.4-1.1C\bin

// проверим реальный статус сервера:

pg_ctl.exe status

// ответом скорее всего будет server running
// пробуем остановить деликатно:

pg_ctl.exe stop -m fast

// если выдаст сообщением, что остановить не удалось, то меняем параметр:

pg_ctl.exe stop -m immediate

// после остановки пробуем запустить:

pg_ctl.exe start

// затем мягко останавливаем:

pg_ctl.exe stop -m fast

// переходим в Службы windows и запускаем PostgreSQL Database Server
// теперь должна запуститься без ошибок и без проблем
```

<figure><img src="/files/tqRKyPCydtyDeaMFQFvv" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://znak1c.gitbook.io/reanimirovat-postgres/sluzhba-ne-zapuskaetsya.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
