docs/docs/en/data-sources/main/postgresql.md
PostgreSQL can be used as the NocoBase main database. It stores NocoBase system-table data and business data in the main data source. Configure the main database when deploying NocoBase; it cannot be deleted after the application is running.
| Setting | Description |
|---|---|
| Supported version | >= 10. |
| Commercial editions | Community, Standard, Professional, and Enterprise. |
| Database type | PostgreSQL. |
PostgreSQL supports inheritance collections, which are suitable for data models that need inheritance.
PostgreSQL is built in and does not require a separate plugin.
When you create a field in NocoBase, NocoBase creates the corresponding PostgreSQL column. When you synchronize an existing table, NocoBase maps the PostgreSQL column type to a suitable Field type and Field interface. You can adjust the display interface in field configuration.
| PostgreSQL type | NocoBase Field type | Available Field interfaces |
|---|---|---|
BOOLEAN | boolean | Checkbox, Switch. |
SMALLINT, INTEGER, SERIAL, SMALLSERIAL | integer, boolean, sort | Integer, Sort, Checkbox, Switch, Select, Radio group. |
BIGINT, BIGSERIAL | bigInt, sort | Integer, Sort, Checkbox, Switch, Select, Radio group, Unix timestamp, Created at, Updated at. |
REAL | float | Number, Percent. |
DOUBLE PRECISION | double | Number, Percent. |
DECIMAL, NUMERIC | decimal | Number, Percent, Currency. |
VARCHAR, CHAR | string, password, uuid, nanoid | Input, Email, Phone, Password, Color, Icon, Select, Radio group, UUID, Nano ID. |
TEXT | text, json | Textarea, Markdown, Vditor, Rich text, URL, JSON. |
UUID | uuid | UUID. |
JSON, JSONB | json | JSON. |
TIMESTAMP | date | Date, Time, Created at, Updated at. |
DATE | dateOnly | Date. |
TIME | time | Time. |
POINT, LINESTRING, POLYGON, CIRCLE | point, lineString, polygon, circle | Point, Line string, Polygon, Circle, JSON. |
ARRAY | array | Multiple select, Checkbox group. |
:::warning Note
Unsupported PostgreSQL types are shown separately in field configuration. They require development support before they can be used as normal NocoBase fields.
:::
For common configuration, see Main database.