# 복원 문제: "invalid command \\restrict"

**URL:** https://meta.discourse.org/t/trouble-with-restore-invalid-command-restrict/386992
**Category:** Support
**Created:** [10월 28, 2025, 8:19오후 UTC](https://meta.discourse.org/t/trouble-with-restore-invalid-command-restrict/386992 "2025-10-28T20:19:59Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [10월 28, 2025, 8:19오후 UTC](https://meta.discourse.org/t/trouble-with-restore-invalid-command-restrict/386992/1 "2025-10-28T20:19:59Z")

</div>

"Discourse 3.5.0.beta9-dev - 04dbc622ab1e0197d16703ba47cf005ec93697ee"에서 현재 버전(6f06709643fa5e2253606c46f79d089ca3393ac9)으로 복원하는 데 문제가 있습니다.

```plaintext
[STARTED]
'system' has started the restore!
Marking restore as running...
Making sure /home/pfaffman/src/discourse-repos/discourse/tmp/restores/default/2025-10-28-201139 exists...
Downloading archive to tmp directory...
Extracting dump file...
Validating metadata...
  Current version: 20251024020353
  Restored version: 20250724012518
Enabling readonly mode...
Pausing sidekiq...
Waiting up to 60 seconds for Sidekiq to finish running jobs...
Creating missing functions in the discourse_functions schema...
Restoring dump file... (this may take a while)
invalid command \restrict
EXCEPTION: psql failed: invalid command \restrict

```

`database_restorer`에서 이 `printf` 명령어들을 제거하면 작동합니다:

```plaintext
      <<~CMD
        (
          printf '%s\\n' "\\\\restrict #{nonce}"
          #{sed_command}
          printf '%s\\n' "\\\\unrestrict #{nonce}"
        ) | #{self.class.psql_command} 2>&1
      CMD

```

이것은 아마도 이 커밋과 관련이 있는 것 같습니다.

> <https://github.com/discourse/discourse/commit/2b6675f064c62211f231f2d57305d3bd6209b140>

백업이 생성된 버전(cdck 도커 컨테이너)에서는 다음과 같은 환경입니다:

`PostgreSQL 15.13 (Debian 15.13-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit`

그리고 복원을 시도하는 곳(베어 메탈에서 pg15를 실행 중인 개발 사이트)은 다음과 같습니다:

`PostgreSQL 15.13 (Ubuntu 15.13-1.pgdg22.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit`

이 코드가 무엇을 하려는 것인지 이해하지 못해서 혼란스럽습니다.

---

_[View the full topic](https://meta.discourse.org/t/trouble-with-restore-invalid-command-restrict/386992)._
