DataCater uses a JDBC-based connector for streaming data change events from data pipelines to PostgreSQL.
When assigning a PostgreSQL sink to a data pipeline, the user must map the schema of the pipeline to the schema of the PostgreSQL index.
Please make sure that the PostgreSQL user has been granted the following privileges for the used table: SELECT, INSERT, UPDATE, and DELETE.
You may grant these privileges to an existing user with the following SQL query:
psql> GRANT SELECT, INSERT, UPDATE, DELETE ON [table_name] TO [username];
This sink connector supports the following configuration options:
The hostname or IP address of the machine where PostgreSQL is running.
The port under which PostgreSQL is available (default: 5432).
Whether to use SSL when connecting to the PostgreSQL database or not.
The username used for authenticating with PostgreSQL.
The password of the user used for authenticating with PostgreSQL.
The name of the database that should be used as sink.
The name of the database schema that should be used as sink (default: public).
The name of the database table that should be used as sink. You may retrieve the list of tables available in the given PostgreSQL database by clicking on Fetch table names.
INSERT: Only perform INSERT statements, which resembles an append-only mode.
UPSERT: Perform INSERT, UPDATE, and DELETE statements.
When retrieving the schema of the PostgreSQL table, DataCater performs the following mapping between PostgreSQL's data types and DataCater's data types:
PostgreSQL data type | DataCater data type |
---|---|
BIGINT | Long |
BIGSERIAL | Long |
BIT | Boolean |
BIT VARYING | String |
BOOLEAN | Boolean |
BOX | String |
BYTEA | String |
CHAR | String |
CHARACTER VARYING | String |
CHARACTER | String |
CIDR | String |
CIRCLE | String |
CITEXT | String |
DATE | Date |
DATERANGE | String |
DECIMAL | Double |
DOUBLE PRECISION | Double |
ENUM | String |
INET | String |
INT4RANGE | String |
INT8RANGE | String |
INTEGER | Int |
INTERVAL | String |
JSON | String |
JSONB | String |
LINE | String |
LSEG | String |
LTREE | String |
MACADDR | String |
MONEY | Double |
NUMERIC | Double |
NUMRANGE | String |
PATH | String |
POINT | String |
POLYGON | String |
REAL | Float |
SMALLINT | Int |
SMALLSERIAL | Int |
SERIAL | Int |
TEXT | String |
TIME | Time |
TIMETZ | String |
TIME WITH TIME ZONE | String |
TIMESTAMP | Timestamp |
TIMESTAMP WITHOUT TIME ZONE | Timestamp |
TIMESTAMPTZ | String |
TIMESTAMP WITH TIME ZONE | String |
TSQUERY | String |
TSRANGE | String |
TSTZRANGE | String |
TSVECTOR | String |
TXID_SNAPSHOT | String |
UUID | String |
VARCHAR | String |
XML | String |