Direct PostgreSQL Connection

Connect ForceCnx to any PostgreSQL database using standard host/port credentials.

Prerequisites

Create a Connection

1

Open the New Connection form

From your ForceCnx Dashboard, click + New Connection and select the Direct tab.

2

Enter connection details

Fill in your database connection parameters:

FieldDescriptionExample
HostDatabase server hostname or IPdb.example.com
PortPostgreSQL port5432
DatabaseDatabase namemyapp
UsernameDatabase userforcecnx_reader
PasswordDatabase password
SSL ModeSSL connection moderequire
3

Test and save

Click Create Connection. ForceCnx will test the connection and automatically introspect your database schema to discover available tables.

Network Configuration

Your database must be reachable from ForceCnx over the internet. If your database is behind a firewall, you'll need to allow inbound connections on your PostgreSQL port.

Security: We recommend creating a dedicated read-only database user for ForceCnx rather than using your application's credentials. Grant only SELECT on the specific tables you need.

Recommended Database User Setup

-- Create a read-only user for ForceCnx
CREATE USER forcecnx_reader WITH PASSWORD 'your-secure-password';

-- Grant access to specific tables
GRANT USAGE ON SCHEMA public TO forcecnx_reader;
GRANT SELECT ON TABLE customers, orders, products TO forcecnx_reader;

SSL Modes

ForceCnx supports all standard PostgreSQL SSL modes:

ModeDescription
disableNo SSL (not recommended for production)
requireSSL required, no certificate verification
verify-caSSL required, verify server certificate CA
verify-fullSSL required, verify CA and hostname

Tip: For most cloud-hosted databases, require is sufficient. Use verify-full for maximum security in production environments.

Verify Connection

After creating the connection, ForceCnx automatically runs schema introspection. You'll see your tables listed on the connection detail page. If the connection fails, check:

Next Steps

Once connected, follow the Getting Started guide to map entities, configure field mappings, and set up Salesforce Connect.