Create a new PostgreSQL data source in JetBrains DataGrip by entering host, port, database, user, and password, then test and save the connection.
DataGrip offers code completion, schema navigation, and version control integration, making it a powerful PostgreSQL client for everyday development and analysis.
Install DataGrip, confirm PostgreSQL is running and reachable, and have credentials: host, port (default 5432), database, user, and password. Decide whether you need SSL or an SSH tunnel.
1.Open DataGrip → Database tool-window → “+” → Data Source → PostgreSQL.
2. In the General tab, enter Host, Port, Database, User, and Password.
3. Click Download Drivers if prompted.
4. (Optional) In SSH/SSL, enable an SSH tunnel or SSL mode.
5. Press Test Connection. Green means success.
6. Click OK to save.
Match these fields with your server settings:
Host: db.company.internal
Port: 5432
Database: ecommerce_prod
User: analytics_app
Password: ****
Use require
SSL mode for managed clouds like RDS.For on-prem servers behind firewalls, enable Use SSH tunnel
and provide key or password.
Click Test Connection; ensure Ping and Server version appear. If latency is high, switch the driver protocol to socket
over JDBC.
After saving, expand the new data source.Run this query in a console:
SELECT o.id,
c.name,
o.total_amount
FROM Orders o
JOIN Customers c ON c.id = o.customer_id
WHERE o.order_date = CURRENT_DATE;
Store passwords in DataGrip’s secure vault. Keep the JDBC driver updated. Use read-only roles for analysts. Limit fetch size
to prevent memory spikes on large result sets.
Wrong port: Many managed services use 5432-5433; confirm in the dashboard.Forgetting SSL: RDS/Cloud SQL often mandates SSL; enable it in the SSL tab.
Timeouts: Increase Connection timeout
to 30 s or open firewall ports. Driver mismatch: Redownload the PostgreSQL JDBC driver to match server version.
.
No. DataGrip prompts to download the correct JDBC driver automatically. Click “Download” when asked.
Yes. Create separate data sources, each with its own user credentials, or use clones inside DataGrip for quick switching.
Right-click the data source → “Copy Settings” to clipboard or save it to a .idea
project. Do not share passwords; teammates will be prompted for them.