---
title: "Postgres@1"
description: "Postgres@1 — PostgreSQL and PostgreSQL-compatible databases, no driver needed"
url: "https://docs.justcat.it/reference/data-sources/providers/postgres-1/"
---
# Postgres@1


## Connects to

PostgreSQL, on premises or hosted: Azure Database for PostgreSQL, Amazon Aurora PostgreSQL, Google Cloud for PostgreSQL — anything that speaks the PostgreSQL wire protocol.

## Example


**Properties**



Name
: Passengers

Provider
: Postgres@1

Technology
: PostgreSql

Connection string
: ```
  Host=localhost;
  Port=5432;
  Database=aero_operations;
  Username=cat_tester;
  Password=%PASSENGERS_PASSWORD%;
  ```





**YAML**


```yaml
Data sources:
- Name: Passengers
  Provider: Postgres@1
  Technology: PostgreSql
  Connection string: >
    Host=localhost;
    Port=5432;
    Database=aero_operations;
    Username=cat_tester;
    Password=%PASSENGERS_PASSWORD%;
```




## Connection string

A standard Npgsql connection string — `Key=Value` pairs separated by semicolons. The keys you will use most:

| Key | Meaning |
|---|---|
| `Host` | Server name or address |
| `Port` | `5432` unless your server says otherwise |
| `Database` | Database to connect to |
| `Username`, `Password` | Credentials |
| `SSL Mode` | `Require` for hosted databases — Azure, Aurora and Google Cloud insist on it |
| `CommandTimeout` | Default statement timeout in seconds; a test's own `Timeout` overrides it — see [How every provider is used](https://docs.justcat.it/reference/data-sources/providers/introduction/#how-every-provider-is-used "How every provider is used") |

The full list is in the <a href="https://www.npgsql.org/doc/connection-string-parameters.html" target="_blank">Npgsql documentation</a>.

A password, or the whole string, can come from an environment variable — `%NAME%` is replaced with the value of `NAME`; see [How every provider is used](https://docs.justcat.it/reference/data-sources/providers/introduction/#how-every-provider-is-used "How every provider is used").

### Azure Database for PostgreSQL

A hosted database needs `SSL Mode=Require`:


**Properties**



Name
: Passengers

Provider
: Postgres@1

Technology
: AzureDatabaseForPostgreSql

Connection string
: ```
  Host=psql-aero-prod.postgres.database.azure.com;
  Database=aero_operations;
  Username=cat_tester;
  Password=%PASSENGERS_PASSWORD%;
  SSL Mode=Require;
  ```





**YAML**


```yaml
Data sources:
- Name: Passengers
  Provider: Postgres@1
  Technology: AzureDatabaseForPostgreSql
  Connection string: >
    Host=psql-aero-prod.postgres.database.azure.com;
    Database=aero_operations;
    Username=cat_tester;
    Password=%PASSENGERS_PASSWORD%;
    SSL Mode=Require;
```




## Settings

None beyond `Connection string`.

## Query

One SQL statement in PostgreSQL's dialect that returns a result set — a `SELECT`, or a call to a set-returning function (`SELECT * FROM report.passenger_counts()`).

## Prerequisites

None. The driver ships with CAT; Windows and Linux alike.

## Serving test and data source definitions

`Postgres@1` can also serve [lists](https://docs.justcat.it/reference/project-file/lists/ "Lists") of definitions: any statement that returns the columns of a [test](https://docs.justcat.it/reference/tests/properties/ "Test properties"), [data source](https://docs.justcat.it/reference/data-sources/properties/ "Data source properties") or [query](https://docs.justcat.it/reference/queries/properties/ "Query properties") definition works. Ready-made table scripts are in [Store definitions in a database](https://docs.justcat.it/how-to-guides/organize-and-run-tests/store-definitions-in-a-database/ "Store definitions in a database").

## Related

* [Technologies](https://docs.justcat.it/reference/data-sources/technologies/ "Technologies") — the PostgreSQL-compatible platforms this provider serves.
* [PostgreSQL output](https://docs.justcat.it/reference/outputs/postgres/ "PostgreSQL output") — the same database can also receive the test results.

