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

> Reference and syntax for CREATE LOCATION with a Postgres source.

# CREATE LOCATION (Postgres)

<Warning>
  **Private Preview Feature**

  This feature is currently in private preview. Contact [support@firebolt.io](mailto:support@firebolt.io) to request early access.
</Warning>

Creates a location object that stores the connection details, credentials, and publication for a Postgres database, for use with [change data capture streams](/guides/change-data-capture/postgres).

## Syntax

```sql theme={"theme":{"light":"css-variables","dark":"css-variables"}}
CREATE LOCATION [IF NOT EXISTS] <location_name> WITH (
    SOURCE      = 'POSTGRES',
    HOST        = '<host>',
    [PORT       = '<port>',]
    DATABASE    = '<database>',
    USER        = '<user>',
    PASSWORD    = '<password>',
    PUBLICATION = '<publication>'
    [, DESCRIPTION = '<description>']
);
```

## Parameters

| Parameter         | Description                                                                                                                                                                                                                                                                 |
| :---------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `<location_name>` | A unique identifier for the location within your account.                                                                                                                                                                                                                   |
| `SOURCE`          | Must be `'POSTGRES'`.                                                                                                                                                                                                                                                       |
| `HOST`            | Hostname of the Postgres server. Required.                                                                                                                                                                                                                                  |
| `PORT`            | Port of the Postgres server. Optional; defaults to `5432`.                                                                                                                                                                                                                  |
| `DATABASE`        | Database to connect to. Required.                                                                                                                                                                                                                                           |
| `USER`            | Role to connect as. Needs the `REPLICATION` attribute and `SELECT` on the captured tables. Required.                                                                                                                                                                        |
| `PASSWORD`        | Password for the role. Required.                                                                                                                                                                                                                                            |
| `PUBLICATION`     | The Postgres publication that covers the tables to capture. Required. For partitioned source tables, each leaf partition additionally needs its own dedicated publication; see [Partitioned source tables](/guides/change-data-capture/postgres#partitioned-source-tables). |
| `DESCRIPTION`     | Optional metadata describing the location's purpose.                                                                                                                                                                                                                        |

## TLS

Connections to any host other than `localhost` use TLS, verified against the operating system trust store of the Firebolt nodes. There is no connection-level option to disable verification or point at a CA file; to use a private certificate authority, install its certificate into the nodes' system trust store.

## Example

```sql theme={"theme":{"light":"css-variables","dark":"css-variables"}}
CREATE LOCATION pg_prod WITH (
    SOURCE      = 'POSTGRES',
    HOST        = 'pg.example.internal',
    PORT        = '5432',
    DATABASE    = 'app',
    USER        = 'firebolt_cdc',
    PASSWORD    = '********',
    PUBLICATION = 'firebolt_cdc',
    DESCRIPTION = 'Production OLTP primary'
);
```

## Related

* [Postgres CDC](/guides/change-data-capture/postgres): source prerequisites and end-to-end setup.
* [CREATE STREAM](/reference-sql/commands/data-definition/create-stream#postgres-streams): bind a stream to a table in this location.
* [CREATE LOCATION](/reference-sql/commands/data-definition/create-location): location objects in general.
* [DROP LOCATION](/reference-sql/commands/data-definition/drop-location)
