PostgreSQL

View as Markdown

PostgreSQL is an advanced open-source relational database system known for its robustness and scalability. It supports various data types and features like transaction management and full-text search.

What you can do with this integration

The integration for PostgreSQL lets you:

  • Read users from a PostgreSQL database and unify them as user profiles inside Krenalis.
  • Write unified users back into PostgreSQL and keep the target table synchronized over time.

You can use it both to collect user data and to activate user profiles.

Perform incremental imports in a query

If incremental import is enabled, you must use the updated_at placeholder in the query, as shown in the following example:

SELECT first_name, last_name, phone_number
FROM customers
WHERE updated_at >= ${updated_at}
ORDER BY updated_at

The column used in the WHERE statement must be the same column selected as the update time column in the pipeline, and the query must return the rows ordered by this column in ascending order. For example, if the update time column is a datetime column and the update time is 2025-01-30 16:12:25.837, the executed query would be:

SELECT first_name, last_name, phone_number
FROM customers
WHERE updated_at >= '2025-01-30 16:12:25.837'
ORDER BY updated_at

If incremental import is not enabled, ${updated_at} will be NULL. To make the query work whether or not incremental import is enabled, you can write it as follows:

SELECT first_name, last_name, phone_number
FROM customers
WHERE updated_at >= ${updated_at} OR ${updated_at} IS NULL 
ORDER BY updated_at