PostgreSQL
Data source: External PostgreSQLStandard Edition+Introduction
PostgreSQL can be connected to NocoBase as an external database. NocoBase reads PostgreSQL tables, fields, and views and uses them as collections in the external data source.
Unlike the main database, the original business system, database client, or migration scripts continue to maintain the real PostgreSQL schema. NocoBase reads structure, stores field metadata, and configures blocks, permissions, workflows, and APIs.
Use external PostgreSQL to connect existing ERP, MES, WMS, or CRM databases; build management pages without migrating historical data; apply permissions, workflows, corrections, or reports to existing tables; and leave schema maintenance to DBAs, migration scripts, or the original system.
External PostgreSQL is not the NocoBase system database. NocoBase does not manage its backup, restore, migrations, or schema changes.
Plugin installation
This is a commercial plugin. See the commercial plugin activation guide for activation.
Add a data source
In Data source management, click Add new, select PostgreSQL, and enter the connection information.

For a database with many objects, narrow the scope with Schema, Table prefix, and Collections. Import only tables and views that the application needs so that permission configuration, page building, and later synchronization remain manageable.
Select collections
After connection settings are entered, click Load Collections to read available PostgreSQL tables and views. Results depend on the connection account, Schema, Table prefix, and Collections settings.
Add all collections is enabled by default and imports every table and view in the current scope. Disable it and select individual tables or views when only part of the database is needed.

One external data source can import at most 500 tables or views. Narrow the scope with Schema, Table prefix, or Collections when PostgreSQL has many objects.
Synchronize and configure fields
PostgreSQL maintains the external table structure. NocoBase does not create columns, change column types, or delete real fields in external PostgreSQL.
When the PostgreSQL schema changes, use Sync from database to reread collection and field metadata. Synchronization updates NocoBase collections, fields, primary keys, unique keys, and type mappings; it does not delete real PostgreSQL tables or data.
After synchronization, configure field titles, Field types, and Field interfaces in NocoBase. NocoBase relation fields are relation metadata only and do not automatically add real foreign-key columns to PostgreSQL.
Field type mapping
NocoBase automatically maps PostgreSQL types to suitable Field types and Field interfaces. You can adjust the display interface in field configuration.
Unsupported PostgreSQL types are shown separately in field configuration. They require development support before they can be used as normal NocoBase fields.
Primary key and Record unique key
Collections used for block display and editing should have a primary key or unique field. NocoBase uses the primary key as the Record unique key when available.
For views, tables without a primary key, or composite-primary-key tables, configure Record unique key manually. Without a usable identifier, blocks might not view, edit, or delete records correctly.

Related links
- External databases - General external-database configuration and management.
- Data source management - Data-source entry points and management.
- Collection fields - Field types and mapping.

