> ## Documentation Index
> Fetch the complete documentation index at: https://julius.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Setup PostgreSQL

> Learn how to securely connect Julius to your PostgreSQL database to analyze your data directly without uploading files.

## Setting Up a PostgreSQL Connection

<Steps>
  <Step title="Click 'Create new Data Connector'" icon="plus">
    On the Data Connectors page, click the **"Create new Data Connector"** button and select **PostgreSQL** from the available options.
  </Step>

  <Step title="Test and Save Connection" icon="check">
    1. Click **"Add Connection"** to test the connection
    2. Julius will attempt to connect to your database with the provided credentials
    3. If successful, your connector will be saved and ready to use
    4. If there's an error, double-check your credentials and network settings

    <Tip>
      If the connection fails, common issues include:

      * Incorrect host or port
      * Database not allowing external connections
      * Wrong username/password
    </Tip>
  </Step>
</Steps>

***

## Connection Setup

### Required Fields

<Note>
  Fields marked with an asterisk (\*) are required to establish a connection.
</Note>

<ResponseField name="Connection Name" type="string" required>
  * **What it is:** A friendly name to identify this connection in Julius
  * **Example:** "Production DB" or "Sales Database"
  * **Tip:** Choose a name that helps you remember which database this connects to
</ResponseField>

<ResponseField name="Host" type="string" required>
  * **What it is:** The server address where your PostgreSQL database is hosted
  * **Format:** Can be an IP address (like `192.168.1.100`) or domain name (like `db.mycompany.com`)
  * **For cloud databases:** This is typically provided by your cloud provider (AWS RDS, Google Cloud SQL, etc.)
</ResponseField>

<ResponseField name="Port" type="number" required>
  * **What it is:** The network port your PostgreSQL database uses for connections
  * **Default:** PostgreSQL typically uses port `5432`
  * **When to change:** Only change this if your database administrator has configured a custom port
</ResponseField>

<ResponseField name="Database" type="string" required>
  * **What it is:** The specific database name within your PostgreSQL server that contains the data you want to analyze
  * **Example:** `sales_data`, `customers`, `analytics`
</ResponseField>

<ResponseField name="User" type="string" required>
  * **What it is:** Your PostgreSQL database username
  * **Technical note:** This is the username that has permission to access the database you want to analyze
  * **Security:** Julius encrypts and securely stores this credential
</ResponseField>

<ResponseField name="Password" type="string" required>
  * **What it is:** The password for your PostgreSQL user account
  * **Security:** Your password is encrypted in transit and at rest
</ResponseField>

<ResponseField name="MFA_TYPE" type="string">
  * **What it is:** Multi-Factor Authentication type if your database requires additional security
  * **When needed:** Only if your database has been configured with additional authentication requirements
  * **Most users:** Can leave this blank unless specifically told otherwise by your database administrator
</ResponseField>

## Security & Trust

* **SOC 2 Type 2 Certified:** Julius meets strict security standards for handling sensitive data
* **Encryption:** All credentials and data are encrypted both in transit and at rest
* **No Data Storage:** Julius doesn't permanently store your data - it only queries what you request
* **Access Control:** Only you can access connections you create

<Card title="Learn More About Security" icon="shield-check" href="https://julius.ai/security">
  Visit our Security & Trust Center to learn more about how Julius protects your data and maintains compliance standards.
</Card>

## Using Your Data Connector

Once your PostgreSQL connector is set up:

1. **Start a new conversation** or continue an existing one

2. **Ask Julius about your data** using natural language:
   * "Show me all customers from the users table"
   * "What's the average order value this month?"
   * "Create a chart of sales by region"

3. **Julius will automatically:**
   * Connect to your database
   * Write and execute the appropriate SQL queries
   * Present the results as tables and charts
   * Create visualizations when requested

<Tip>
  You don't need to know SQL! Just ask Julius what you want to know about your data in plain English, and it will handle the technical details.
</Tip>

## Troubleshooting Common Issues

<Accordion title="Connection timeout or can't connect">
  * Verify your host and port are correct
  * Check if your database allows external connections
  * Confirm your database is running and accessible
</Accordion>

<Accordion title="Authentication failed">
  * Double-check your username and password
  * Verify the user has permission to access the specified database
  * Make sure the database name is spelled correctly
</Accordion>

<Accordion title="Julius says it can't find my tables">
  * Confirm your user has read permissions on the tables you want to analyze
  * Check that you're connected to the correct database (not just the PostgreSQL server)
  * Verify table names and schemas are accessible to your user account
</Accordion>

## Best Practices

* **Use read-only credentials** when possible to prevent accidental data modification
* **Create a dedicated Julius user** in your database with only the permissions needed for analysis
* **Test connections with non-production data** first to ensure everything works correctly
* **Monitor database performance** when running complex queries through Julius

<Warning>
  Always coordinate with your database administrator when setting up data connectors to ensure proper security and performance guidelines are followed.
</Warning>

***

<Info>
  Reach out to [**team@julius.ai**](mailto:team@julius.ai) for support or to ask questions not answered in our documentation.
</Info>
