Postgres@1
Postgres@1 reads data from PostgreSQL and PostgreSQL-compatible databases. Nothing to install.
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
- Name
- Passengers
- Technology
- PostgreSQL
- Provider
- Postgres@1
- Connection string
Host=localhost; Port=5432; Database=aero_operations; Username=cat_tester; Password=%PASSENGERS_PASSWORD%;
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 |
The full list is in the Npgsql documentation.
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.
Azure Database for PostgreSQL
A hosted database needs SSL Mode=Require:
- Name
- Passengers
- Technology
- Azure Database for PostgreSQL
- Provider
- Postgres@1
- Connection string
Host=psql-aero-prod.postgres.database.azure.com; Database=aero_operations; Username=cat_tester; Password=%PASSENGERS_PASSWORD%; SSL Mode=Require;
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 of definitions: any statement that returns the columns of a test, data source or query definition works. Ready-made table scripts are in Store definitions in a database.
Related
- Technologies — the PostgreSQL-compatible platforms this provider serves.
- PostgreSQL output — the same database can also receive the test results.