Back to Integrations
PostgreSQL logo

PostgreSQL Integration

Full support for PostgreSQL 12+

Automatically discover and classify PII fields in your PostgreSQL database. Our AI scans table schemas and sample data to identify personal information like emails, phone numbers, Aadhaar numbers, and more — helping you build your DPDP data map.

Prerequisites

Network Access

  • Your PostgreSQL server must be accessible from the internet, or you can whitelist our IPs
  • Port 5432 (or your custom port) must be open
  • SSL/TLS connection recommended (we support both)

Database User

Create a read-only user with minimal privileges. We only need to read schema metadata and sample a few rows.

-- Create a read-only user for Privacy Labs
CREATE USER privacylabs_scanner WITH PASSWORD 'your_secure_password';

-- Grant connect permission
GRANT CONNECT ON DATABASE your_database TO privacylabs_scanner;

-- Grant schema usage
GRANT USAGE ON SCHEMA public TO privacylabs_scanner;

-- Grant SELECT on all tables (read-only)
GRANT SELECT ON ALL TABLES IN SCHEMA public TO privacylabs_scanner;

-- For future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public 
GRANT SELECT ON TABLES TO privacylabs_scanner;

Minimum Privileges Required

Required

  • CONNECT on database
  • USAGE on schema
  • SELECT on tables

Not Required

  • INSERT, UPDATE, DELETE
  • CREATE, DROP, ALTER
  • SUPERUSER privileges

Step-by-Step Setup

1

Navigate to Integrations

In your admin dashboard, go to Data Discovery → Integrations and click Add Connection.

2

Select PostgreSQL

Choose PostgreSQL from the list of supported databases.

3

Enter Connection Details

Fill in your database credentials. You can use a connection string or enter fields individually.

Host:db.example.com
Port:5432
Database:production_db
Username:privacylabs_scanner
SSL Mode:require
4

Test Connection

Click Test Connection to verify credentials. If successful, click Save.

5

Run Discovery Scan

Go to Data Discovery → Run Discovery, select your PostgreSQL connection, and start the scan.

What We Scan vs. What We Don't

What We Scan

  • Schema metadata: Table names, column names, data types
  • Sample data: Up to 100 rows per table for PII detection
  • Column statistics: Null counts, distinct values (for risk assessment)
  • Relationships: Foreign keys to map data flows

What We Never Touch

  • Bulk data export: We never download full tables
  • Data modification: No INSERT, UPDATE, or DELETE
  • Schema changes: No CREATE, DROP, or ALTER
  • Stored data: Sample data is analyzed in-memory, never persisted

Security

Encrypted Credentials

Your database password is encrypted with AES-256 at rest.

TLS Connections

All connections use TLS encryption in transit.

IP Whitelisting

Static IPs available for firewall rules on request.

Audit Logged

All scan activities are logged for compliance.

Ready to Scan Your PostgreSQL Database?

Connect in under 5 minutes and discover PII fields automatically.

Book a Demo