PostgreSQLΒΆ

To implement the conversion of relational data to graph data using GART, the data source needs to be configured with the necessary permissions. Here is an example of PostgreSQL.

The PostgreSQL configuration file is in the directory /etc/postgresql/$PSQL_VERSION/main/. In our docker image, the PostgreSQL version is 16, so the configuration file is in the directory /etc/postgresql/16/main/.

  1. Modify the configuration file postgresql.conf to enable WAL as follows:

wal_level = logical
max_replication_slots = 10  # larger than 0, default is 10
max_wal_senders = 10  # larger than 0, default is 10
  1. Create a PostgreSQL user (dbuser) for the log capture Debezium:

1CREATE USER dbuser WITH PASSWORD '123456';
2ALTER USER dbuser REPLICATION;
3ALTER USER dbuser LOGIN;
4GRANT pg_read_server_files TO dbuser;       -- For loading CSV files
5
6CREATE DATABASE ldbc;
7GRANT ALL ON DATABASE ldbc TO dbuser;
  1. Switch to the database ldbc and create the schema public:

\c ldbc
GRANT ALL ON SCHEMA public TO dbuser;
  1. Modify the configuration file /etc/postgresql/$PSQL_VERSION/main/pg_hba.conf to trust the user dbuser:

local   replication     dbuser                          trust
host    replication     dbuser  127.0.0.1/32            trust
host    replication     dbuser  ::1/128                 trust
  1. Restart PostgreSQL:

gart-env$ sudo /etc/init.d/postgresql restart