Postgres
Ingest tables from a PostgreSQL database with a SQL query.
The Postgres connector ingests data from a PostgreSQL database. You give it a query, and the rows it returns become a table in Gaur.
Create a secret
The Postgres connector needs a Postgres secret to connect to your database. Create one with connector type Postgres and these fields:
| Field | Required | Description |
|---|---|---|
host | Yes | Database host. |
port | Yes | Database port. |
database | Yes | Database name. |
user | Yes | Database user. |
password | Yes | Password for the user. |
schema | No | Default schema to use. |
sslmode | No | SSL mode for the connection. Defaults to disable. |
Give Gaur a read-only database user where you can. The credentials are encrypted and reused for every ingestion and refresh from this database.
Ingest a table
Choose the Postgres connector
In the Ingestion area, pick Postgres and select the Postgres secret you created.
Write the query
Provide a SELECT query for the data you want. Its result set becomes the
table, so shape it the way you need: pick columns, join, and filter in the
query.
Name the table and ingest
Name the resulting table. Gaur runs the ingestion as a background job, infers the schema, and creates the table.
Set up incremental refresh
Postgres tables can refresh incrementally, pulling only rows that changed
since the last run. To enable it, configure a cursor when you ingest: a
column Gaur watches to know where it left off, such as an auto-incrementing id
or an updated_at timestamp, along with that column's type.
Without a cursor, the table still supports full and append refreshes. See Refreshes for how the modes differ.
Refreshing
Postgres tables support full, append, and incremental refreshes, on demand or on a schedule. See Refreshes.