diff --git a/CONFIG.md b/CONFIG.md index fbee178f..72d5683a 100644 --- a/CONFIG.md +++ b/CONFIG.md @@ -256,6 +256,39 @@ Current options: `pg_bigint_hash`: PARTITION BY HASH (Postgres hashing function) `sha1`: A hashing function based on SHA1 +### auth_query +``` +path: pools..auth_query +default: +example: "SELECT $1" +``` + +Query to be sent to servers to obtain the hash used for md5 authentication. The connection will be +established using the database configured in the pool. This parameter is inherited by every pool +and can be redefined in pool configuration. + +### auth_query_user +``` +path: pools..auth_query_user +default: +example: "sharding_user" +``` + +User to be used for connecting to servers to obtain the hash used for md5 authentication by sending the query +specified in `auth_query_user`. The connection will be established using the database configured in the pool. +This parameter is inherited by every pool and can be redefined in pool configuration. + +### auth_query_password +``` +path: pools..auth_query_password +default: +example: "sharding_user" +``` + +Password to be used for connecting to servers to obtain the hash used for md5 authentication by sending the query +specified in `auth_query_user`. The connection will be established using the database configured in the pool. +This parameter is inherited by every pool and can be redefined in pool configuration. + ### automatic_sharding_key ``` path: pools..automatic_sharding_key diff --git a/pgcat.toml b/pgcat.toml index c9faef8f..6cb9a299 100644 --- a/pgcat.toml +++ b/pgcat.toml @@ -113,6 +113,21 @@ primary_reads_enabled = true # `sha1`: A hashing function based on SHA1 sharding_function = "pg_bigint_hash" +# Query to be sent to servers to obtain the hash used for md5 authentication. The connection will be +# established using the database configured in the pool. This parameter is inherited by every pool +# and can be redefined in pool configuration. +# auth_query = "SELECT $1" + +# User to be used for connecting to servers to obtain the hash used for md5 authentication by sending the query +# specified in `auth_query_user`. The connection will be established using the database configured in the pool. +# This parameter is inherited by every pool and can be redefined in pool configuration. +# auth_query_user = "sharding_user" + +# Password to be used for connecting to servers to obtain the hash used for md5 authentication by sending the query +# specified in `auth_query_user`. The connection will be established using the database configured in the pool. +# This parameter is inherited by every pool and can be redefined in pool configuration. +# auth_query_password = "sharding_user" + # Automatically parse this from queries and route queries to the right shard! # automatic_sharding_key = "data.id"