# Configure Discourse to use a separate PostgreSQL server

**URL:** https://meta.discourse.org/t/configure-discourse-to-use-a-separate-postgresql-server/46375
**Category:** Self-Hosting
**Tags:** how-to
**Created:** [6월 23, 2016, 11:48오후 UTC](https://meta.discourse.org/t/configure-discourse-to-use-a-separate-postgresql-server/46375 "2016-06-23T23:48:02Z")
**Posts on this page:** 11
**Page:** 3

<div class="post-metadata">

### Author: ![maggiomj](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@maggiomj](https://meta.discourse.org/u/maggiomj)
#### Post date: [9월 20, 2023, 2:29오후 UTC](https://meta.discourse.org/t/configure-discourse-to-use-a-separate-postgresql-server/46375/43 "2023-09-20T14:29:28Z")

</div>

아니요, 괜찮습니다. 정보 주셔서 감사합니다.

---

<div class="post-metadata">

### Author: ![dalu74](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dalu74/32/350170_2.png) [@dalu74](https://meta.discourse.org/u/dalu74)
#### Post date: [12월 21, 2023, 4:04오후 UTC](https://meta.discourse.org/t/configure-discourse-to-use-a-separate-postgresql-server/46375/44 "2023-12-21T16:04:06Z")

</div>

내 경우에는 [인증 메커니즘](https://www.prisma.io/dataguide/postgresql/authentication-and-authorization/configuring-user-authentication)에 `trust`가 아닌 `scram-sha-256`을 사용하고 있었기 때문입니다.  
`scram-sha-256`은 물리적 사용자를 요구하기 때문입니다.  
`pg_ident.conf`에서 사용자 맵을 생성하여 우회할 수 있을지 모르겠지만, 정확한 방법은 잘 모르겠습니다.

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [12월 22, 2023, 3:34오전 UTC](https://meta.discourse.org/t/configure-discourse-to-use-a-separate-postgresql-server/46375/45 "2023-12-22T03:34:27Z")

</div>

“물리적 사용자”가 “Unix 시스템 사용자”를 의미한다면, `scram-sha-256`은 시스템에 해당 사용자가 설정되어 있을 필요는 없습니다. `peer` 메서드는 시스템 사용자를 요구하며, 원격 데이터베이스 서버를 사용할 때 `trust`는 전반적으로 매우 나쁜 아이디어입니다.

---

<div class="post-metadata">

### Author: ![harishg33](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/harishg33/32/496490_2.png) [@harishg33](https://meta.discourse.org/u/harishg33)
#### Post date: [7월 23, 2025, 8:12오전 UTC](https://meta.discourse.org/t/configure-discourse-to-use-a-separate-postgresql-server/46375/46 "2025-07-23T08:12:11Z")

</div>

기존 프로세스 외에 아래 내용을 추가로 포함해야 하나요?

```plaintext
CREATE EXTENSION vector;

```

discourse\_docker의 postgres 템플릿에서 이 확장 기능이 보이기 때문입니다.

> <https://github.com/discourse/discourse_docker/blob/c36fb79077f07fc2031176eaeedac3720db7b70c/templates/postgres.template.yml#L239C1-L257C191>

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [7월 24, 2025, 11:18오후 UTC](https://meta.discourse.org/t/configure-discourse-to-use-a-separate-postgresql-server/46375/47 "2025-07-24T23:18:28Z")

</div>

이것은 Discourse AI 코어 플러그인에서 사용되므로, 해당 플러그인을 사용 중이라면 필요합니다.

---

<div class="post-metadata">

### Author: ![harishg33](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/harishg33/32/496490_2.png) [@harishg33](https://meta.discourse.org/u/harishg33)
#### Post date: [7월 25, 2025, 2:59오전 UTC](https://meta.discourse.org/t/configure-discourse-to-use-a-separate-postgresql-server/46375/48 "2025-07-25T02:59:38Z")

</div>

그 플러그인을 활성화한 기억이 없습니다. 사실 방금 확인해 보니 비활성화되어 있었습니다. 하지만 최근에 이미지를 재빌드했을 때, 최신 커밋이 이 커밋 - [GitHub - discourse/discourse at 0eab7daea450e1d7e416c46a23aaaf95687d4855 · GitHub](https://github.com/discourse/discourse/tree/0eab7daea450e1d7e416c46a23aaaf95687d4855) - 을 넘어서자 `rake db:migrate`가 실패하기 시작했습니다. 위 커밋 바로 앞 커밋으로 부트스트랩을 했을 때는 계속 정상적으로 작동했습니다.

이제 이 확장 기능을 활성화했더니, 해당 커밋 이후의 커밋들은 문제없이 작동하고 있습니다.

---

<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: [7월 25, 2025, 5:54오전 UTC](https://meta.discourse.org/t/configure-discourse-to-use-a-separate-postgresql-server/46375/49 "2025-07-25T05:54:13Z")

</div>

하지만 이제 AI 플러그인이 코어에 포함되었기 때문에, AI 플러그인을 사용하든(혹은 의도적으로 제거하든) 확장 기능이 필요하다는 뜻이죠?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [7월 25, 2025, 4:48오후 UTC](https://meta.discourse.org/t/configure-discourse-to-use-a-separate-postgresql-server/46375/50 "2025-07-25T16:48:34Z")

</div>

맞아요, 마이그레이션은 플러그인이 활성화되어 있는지와 무관하게 독립적으로 실행되니까요.

---

<div class="post-metadata">

### Author: ![kyfrankie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kyfrankie/32/538187_2.png) [@kyfrankie](https://meta.discourse.org/u/kyfrankie)
#### Post date: [1월 8, 2026, 3:36오후 UTC](https://meta.discourse.org/t/configure-discourse-to-use-a-separate-postgresql-server/46375/51 "2026-01-08T15:36:11Z")

</div>

관리형 PostgreSQL 서버를 슈퍼유저가 아닌 계정으로 사용 중인 경우, vector 확장이 수동으로 데이터베이스에 추가되었음에도 불구하고 EnablePgVectorExtension (‘20230710171141’) 단계에서 DB 마이그레이션이 실패합니다. 이 마이그레이션 단계를 비활성화하거나 vector 확장이 이미 존재하는지 확인하는 방법이 있을까요?

원인:  
ActiveRecord::StatementInvalid: PG::InsufficientPrivilege: ERROR: vector는 신뢰할 수 있는 확장이 아니므로, "azure\_pg\_admin"의 구성원만 CREATE EXTENSION vector를 사용할 수 있습니다 (ActiveRecord::StatementInvalid)  
HINT: 확장을 허용하는 방법 또는 허용된 확장 목록을 확인하려면 [Search - Microsoft Bing](https://go.microsoft.com/fwlink/?linkid=2301063%EC%9D%84) 참조하세요.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [1월 8, 2026, 6:17오후 UTC](https://meta.discourse.org/t/configure-discourse-to-use-a-separate-postgresql-server/46375/52 "2026-01-08T18:17:07Z")

</div>

지난 달에 이 문제를 처리하기 위한 PR을 병합했습니다. 최신 버전을 사용 중이신가요?

> <https://github.com/discourse/discourse/pull/35070>
>
> On certain hosting environments (azure postgres flex notably) CREATE EXTENSION r…equires a high level of permissions if the extension in question is marked as "untrusted" by postgres. This level of permission might not be available at runtime if the database user has low privileges.
> 
> Unfortunately, the migration currently tries to CREATE EXTENSION even if the "vector" extension already exists, which causes an unavoidable permission error.
> 
> This PR just adds a check to see if "vector" is already present, and skips if it is.

---

<div class="post-metadata">

### Author: ![kyfrankie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kyfrankie/32/538187_2.png) [@kyfrankie](https://meta.discourse.org/u/kyfrankie)
#### Post date: [1월 8, 2026, 8:30오후 UTC](https://meta.discourse.org/t/configure-discourse-to-use-a-separate-postgresql-server/46375/53 "2026-01-08T20:30:56Z")

</div>

감사합니다! 저는 discourse/discourse:3.5.3 도커 이미지를 사용하고 있습니다. 최신 PR이 포함되어 있는지 확실하지 않습니다. (수정: [Release v2025.12.0](https://meta.discourse.org/t/release-v2025-12-0-discourse-rewind-new-review-queue-and-ui-to-create-tags-chat-channel-customisation-and-live-pr-statuses/392314)에는 해당 PR이 포함되어 있으며 Azure DB와 함께 작동합니다)

[Previous page](https://meta.discourse.org/t/configure-discourse-to-use-a-separate-postgresql-server/46375.md?page=2)
