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

# PostgreSQL

> Connecting PostgreSQL databases to Galaxy

Connect Galaxy to a PostgreSQL database to observe schemas, tables, columns, and relationships.

<Frame>
  <img src="https://mintcdn.com/galaxy-d7fe996b/6-Rz1rpIBcXfVZgy/images/postgres.jpg?fit=max&auto=format&n=6-Rz1rpIBcXfVZgy&q=85&s=5179c06962473610a83db0acaa223d6a" alt="PostgreSQL source configuration" width="1200" height="630" data-path="images/postgres.jpg" />
</Frame>

## How to Connect

1. **Select PostgreSQL** as the Source type
2. **Provide connection details**:
   * **Host**: Hostname or IP address of your PostgreSQL server
   * **Port**: Port number (default: 5432)
   * **Database**: Name of the database to connect to
   * **Username**: Database username
   * **Password**: Database password
3. **Select schemas**: Choose which schemas Galaxy should observe
4. **Configure SSL mode**: Choose SSL/TLS connection mode
5. **Set replication method**: Choose how Galaxy detects changes:
   * Standard cursor
   * XMIN system column
   * Write-Ahead Log CDC
6. **Optional SSH tunnel**: Configure SSH tunneling if your database is behind a firewall

## Configuration Options

### Connection Settings

* **Host**: PostgreSQL server hostname or IP address
* **Port**: Database port (default: 5432)
* **Database**: Database name
* **Username**: Database username
* **Password**: Database password
* **JDBC URL parameters**: Optional additional JDBC connection parameters

### Schema Selection

Select specific schemas to observe, or observe all schemas. Galaxy only reads structure from selected schemas.

### SSL Mode

* **Disable**: No SSL/TLS encryption
* **Allow**: Try SSL, allow non-SSL if SSL fails
* **Prefer**: Prefer SSL, allow non-SSL if SSL fails
* **Require**: Require SSL/TLS encryption
* **Verify CA**: Require SSL and verify server certificate against CA
* **Verify Full**: Require SSL and verify server certificate including hostname

### Replication Methods

* **Standard cursor**: Uses a user-defined cursor to scan for changes
* **XMIN system column**: Uses PostgreSQL's XMIN system column to detect changes
* **Write-Ahead Log CDC**: Uses PostgreSQL's logical replication and WAL to capture changes in real-time

For CDC, you'll need to provide:

* **Publication name**: PostgreSQL publication name
* **Replication slot**: PostgreSQL replication slot name

### SSH Tunneling

If your database is behind a firewall:

* **No tunnel**: Direct connection (default)
* **SSH key authentication**: Use SSH key for tunnel authentication
* **Password authentication**: Use password for tunnel authentication

Configure SSH tunnel host, port, username, and authentication method.

<Info>
  Don’t see a source type you're looking for? We connect to hundreds of systems - reach out to [support@getgalaxy.io](mailto:support@getgalaxy.io) to request access.
</Info>

## What's Next

<CardGroup cols={2}>
  <Card icon="database" horizontal href="/sources" title="Sources">
    Learn about Sources in general
  </Card>

  <Card icon="diagram-project" horizontal href="/projects" title="Projects">
    Understand how to use Sources in Projects
  </Card>
</CardGroup>
