> For the complete documentation index, see [llms.txt](https://docs.ngsurvey.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ngsurvey.com/ar/installation-setup/installation/alwajhh-alkhlfyh-lqaadh-albyanat/postgresql.md).

# PostgreSQL

باستخدام محرك التخزين Postgres يمكنك استخدام أي قاعدة بيانات مبنية على Postgres كخلفية ngSurvey الخاصة بك.&#x20;

## المتطلبات

لتثبيت ngSurvey على قاعدة بيانات Postgres ستحتاج إلى استيفاء المتطلبات التالية

1. إصدار Postgres 16.x أو أحدث.
2. يجب أن يمتلك المستخدم المستخدم للاتصال بخادم Postgres الصلاحيات الكافية لإنشاء قاعدة بيانات جديدة.&#x20;

## تكوين NGSurvey

لتهيئة ngSurvey للعمل مع Postgres تحتاج إلى إعداد متغيرات البيئة التالية.

{% hint style="info" %}
سيقوم NGSurvey تلقائيًا بإنشاء أو تحديث قاعدة البيانات التي قمت بتحديدها في سلسلة الاتصال. بشكل افتراضي سيستخدم ngSurvey قاعدة البيانات "postgres" كقاعدة صيانة؛ إذا رغبت في تغيير قاعدة الصيانة المستخدمة أثناء إنشاء قاعدة ngsurvey الجديدة يمكنك تغييرها باستخدام متغير البيئة التالي: NGSurvey:PGMaintenanceDB
{% endhint %}

* **`ConnectionStrings:NGSurveyDB`** يحوي سلسلة الاتصال بخادم Postgres الخاص بك.
* **`NGSurvey:StorageEngine`** يجب تعيينه إلى *Postgres.*

## Entra Managed Identity

لاستخدام Entra Managed Identity لمصادقة اتصالك بـ Postgres، يمكنك تحديد اسم مستخدم Entra في سلسلة اتصال PostgreSQL دون أي كلمات مرور. تأكد من أن هذا المستخدم لديه حقوق الوصول المناسبة في قاعدة بيانات PostgreSQL الخاصة بك وأنك تستخدم Flexible Server Host لقاعدة بيانات PostgreSQL الخاصة بك.

## التحقق من الصحة

بمجرد تكوين إعدادات قاعدة البيانات يمكنك إعادة تشغيل خدمة الويب المستضيفة لـ ngSurvey. سيقوم NGSurvey تلقائيًا بإعداد قاعدة البيانات بكل الجداول المطلوبة.

يمكنك أيضًا التحقق مما إذا كان التثبيت قد تم إعداده بشكل صحيح باستخدام الرابط التالي:\
<https://yourrootsite/api/system/status>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.ngsurvey.com/ar/installation-setup/installation/alwajhh-alkhlfyh-lqaadh-albyanat/postgresql.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
