From bfdb8ec3b16b10195822ac3320b80aaa9918f73b Mon Sep 17 00:00:00 2001 From: Rob Pickerill Date: Fri, 17 May 2024 12:11:45 +0100 Subject: [PATCH] update postgres docs for nulls and coalesce Signed-off-by: Rob Pickerill --- content/docs/1.4/scalers/postgresql.md | 2 ++ content/docs/1.5/scalers/postgresql.md | 2 ++ content/docs/2.0/scalers/postgresql.md | 2 ++ content/docs/2.1/scalers/postgresql.md | 2 ++ content/docs/2.10/scalers/postgresql.md | 2 ++ content/docs/2.11/scalers/postgresql.md | 2 ++ content/docs/2.12/scalers/postgresql.md | 2 ++ content/docs/2.13/scalers/postgresql.md | 2 ++ content/docs/2.14/scalers/postgresql.md | 2 ++ content/docs/2.15/scalers/postgresql.md | 4 ++++ content/docs/2.2/scalers/postgresql.md | 2 ++ content/docs/2.3/scalers/postgresql.md | 2 ++ content/docs/2.4/scalers/postgresql.md | 2 ++ content/docs/2.5/scalers/postgresql.md | 2 ++ content/docs/2.6/scalers/postgresql.md | 2 ++ content/docs/2.7/scalers/postgresql.md | 2 ++ content/docs/2.8/scalers/postgresql.md | 2 ++ content/docs/2.9/scalers/postgresql.md | 2 ++ 18 files changed, 38 insertions(+) diff --git a/content/docs/1.4/scalers/postgresql.md b/content/docs/1.4/scalers/postgresql.md index ff52f5df5..d7afbc939 100644 --- a/content/docs/1.4/scalers/postgresql.md +++ b/content/docs/1.4/scalers/postgresql.md @@ -33,6 +33,8 @@ Finally, a user inserts a query that returns the desired value. - `query` - What query to poll postgresql with. Query must return an integer. - `targetQueryValue` - A threshold that is used as `targetAverageValue` in HPA. +> Note that the query must return a single integer value. If the query has a possibility of returning `null`, a default value can be set using the `COALESCE` function. For example, `SELECT COALESCE(column_name, 0) FROM table_name;`. See [PostgreSQL documentation](https://www.postgresql.org/docs/current/functions-conditional.html#FUNCTIONS-COALESCE-NVL-IFNULL) for more information on the `COALESCE` function. + This is an example of using a full connection string: ```yaml diff --git a/content/docs/1.5/scalers/postgresql.md b/content/docs/1.5/scalers/postgresql.md index ff52f5df5..d7afbc939 100644 --- a/content/docs/1.5/scalers/postgresql.md +++ b/content/docs/1.5/scalers/postgresql.md @@ -33,6 +33,8 @@ Finally, a user inserts a query that returns the desired value. - `query` - What query to poll postgresql with. Query must return an integer. - `targetQueryValue` - A threshold that is used as `targetAverageValue` in HPA. +> Note that the query must return a single integer value. If the query has a possibility of returning `null`, a default value can be set using the `COALESCE` function. For example, `SELECT COALESCE(column_name, 0) FROM table_name;`. See [PostgreSQL documentation](https://www.postgresql.org/docs/current/functions-conditional.html#FUNCTIONS-COALESCE-NVL-IFNULL) for more information on the `COALESCE` function. + This is an example of using a full connection string: ```yaml diff --git a/content/docs/2.0/scalers/postgresql.md b/content/docs/2.0/scalers/postgresql.md index 21aaae123..a55d9c5e5 100644 --- a/content/docs/2.0/scalers/postgresql.md +++ b/content/docs/2.0/scalers/postgresql.md @@ -31,6 +31,8 @@ Finally, a user inserts a query that returns the desired value. - `query` - What query to poll postgresql with. Query must return an integer. - `targetQueryValue` - A threshold that is used as `targetAverageValue` in HPA. +> Note that the query must return a single integer value. If the query has a possibility of returning `null`, a default value can be set using the `COALESCE` function. For example, `SELECT COALESCE(column_name, 0) FROM table_name;`. See [PostgreSQL documentation](https://www.postgresql.org/docs/current/functions-conditional.html#FUNCTIONS-COALESCE-NVL-IFNULL) for more information on the `COALESCE` function. + This is an example of using a full connection string: ```yaml diff --git a/content/docs/2.1/scalers/postgresql.md b/content/docs/2.1/scalers/postgresql.md index be36e965b..e7ea26738 100644 --- a/content/docs/2.1/scalers/postgresql.md +++ b/content/docs/2.1/scalers/postgresql.md @@ -34,6 +34,8 @@ Finally, a user inserts a query that returns the desired value. - `targetQueryValue` - A threshold that is used as `targetAverageValue` in HPA. - `metricName` - Name to assign to the metric. If not set KEDA will generate a name based on either the connection string if set or the db name. If using more than one trigger it is required that all metricNames be unique. (Optional) +> Note that the query must return a single integer value. If the query has a possibility of returning `null`, a default value can be set using the `COALESCE` function. For example, `SELECT COALESCE(column_name, 0) FROM table_name;`. See [PostgreSQL documentation](https://www.postgresql.org/docs/current/functions-conditional.html#FUNCTIONS-COALESCE-NVL-IFNULL) for more information on the `COALESCE` function. + This is an example of using a full connection string with `AIRFLOW_CONN_AIRFLOW_DB` set as `postgresql://test@localhost`: ```yaml diff --git a/content/docs/2.10/scalers/postgresql.md b/content/docs/2.10/scalers/postgresql.md index 2bbd57339..2c2d81085 100644 --- a/content/docs/2.10/scalers/postgresql.md +++ b/content/docs/2.10/scalers/postgresql.md @@ -35,6 +35,8 @@ Finally, a user inserts a query that returns the desired value. - `activationTargetQueryValue` - Target value for activating the scaler. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds).(Default: `0`, Optional, This value can be a float) - `metricName` - Name to assign to the metric. If not set KEDA will generate a name based on either the connection string if set or the db name. If using more than one trigger it is required that all metricNames be unique. (DEPRECATED: This parameter is deprecated as of KEDA v2.10 and will be removed in version `2.12`) +> Note that the query must return a single integer value. If the query has a possibility of returning `null`, a default value can be set using the `COALESCE` function. For example, `SELECT COALESCE(column_name, 0) FROM table_name;`. See [PostgreSQL documentation](https://www.postgresql.org/docs/current/functions-conditional.html#FUNCTIONS-COALESCE-NVL-IFNULL) for more information on the `COALESCE` function. + This is an example of using a full connection string with `AIRFLOW_CONN_AIRFLOW_DB` set as `postgresql://test@localhost`: ```yaml diff --git a/content/docs/2.11/scalers/postgresql.md b/content/docs/2.11/scalers/postgresql.md index 2bbd57339..2c2d81085 100644 --- a/content/docs/2.11/scalers/postgresql.md +++ b/content/docs/2.11/scalers/postgresql.md @@ -35,6 +35,8 @@ Finally, a user inserts a query that returns the desired value. - `activationTargetQueryValue` - Target value for activating the scaler. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds).(Default: `0`, Optional, This value can be a float) - `metricName` - Name to assign to the metric. If not set KEDA will generate a name based on either the connection string if set or the db name. If using more than one trigger it is required that all metricNames be unique. (DEPRECATED: This parameter is deprecated as of KEDA v2.10 and will be removed in version `2.12`) +> Note that the query must return a single integer value. If the query has a possibility of returning `null`, a default value can be set using the `COALESCE` function. For example, `SELECT COALESCE(column_name, 0) FROM table_name;`. See [PostgreSQL documentation](https://www.postgresql.org/docs/current/functions-conditional.html#FUNCTIONS-COALESCE-NVL-IFNULL) for more information on the `COALESCE` function. + This is an example of using a full connection string with `AIRFLOW_CONN_AIRFLOW_DB` set as `postgresql://test@localhost`: ```yaml diff --git a/content/docs/2.12/scalers/postgresql.md b/content/docs/2.12/scalers/postgresql.md index eb3147e73..88c3971b2 100644 --- a/content/docs/2.12/scalers/postgresql.md +++ b/content/docs/2.12/scalers/postgresql.md @@ -36,6 +36,8 @@ Finally, a user inserts a query that returns the desired value. This is an example of using a full connection string with `AIRFLOW_CONN_AIRFLOW_DB` set as `postgresql://test@localhost`: +> Note that the query must return a single integer value. If the query has a possibility of returning `null`, a default value can be set using the `COALESCE` function. For example, `SELECT COALESCE(column_name, 0) FROM table_name;`. See [PostgreSQL documentation](https://www.postgresql.org/docs/current/functions-conditional.html#FUNCTIONS-COALESCE-NVL-IFNULL) for more information on the `COALESCE` function. + ```yaml triggers: - type: postgresql diff --git a/content/docs/2.13/scalers/postgresql.md b/content/docs/2.13/scalers/postgresql.md index eb3147e73..bc55a40b3 100644 --- a/content/docs/2.13/scalers/postgresql.md +++ b/content/docs/2.13/scalers/postgresql.md @@ -34,6 +34,8 @@ Finally, a user inserts a query that returns the desired value. - `targetQueryValue` - A threshold that is used as `targetValue` or `targetAverageValue` (depending on the trigger metric type) in HPA. (This value can be a float) - `activationTargetQueryValue` - Target value for activating the scaler. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds).(Default: `0`, Optional, This value can be a float) +> Note that the query must return a single integer value. If the query has a possibility of returning `null`, a default value can be set using the `COALESCE` function. For example, `SELECT COALESCE(column_name, 0) FROM table_name;`. See [PostgreSQL documentation](https://www.postgresql.org/docs/current/functions-conditional.html#FUNCTIONS-COALESCE-NVL-IFNULL) for more information on the `COALESCE` function. + This is an example of using a full connection string with `AIRFLOW_CONN_AIRFLOW_DB` set as `postgresql://test@localhost`: ```yaml diff --git a/content/docs/2.14/scalers/postgresql.md b/content/docs/2.14/scalers/postgresql.md index eb3147e73..bc55a40b3 100644 --- a/content/docs/2.14/scalers/postgresql.md +++ b/content/docs/2.14/scalers/postgresql.md @@ -34,6 +34,8 @@ Finally, a user inserts a query that returns the desired value. - `targetQueryValue` - A threshold that is used as `targetValue` or `targetAverageValue` (depending on the trigger metric type) in HPA. (This value can be a float) - `activationTargetQueryValue` - Target value for activating the scaler. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds).(Default: `0`, Optional, This value can be a float) +> Note that the query must return a single integer value. If the query has a possibility of returning `null`, a default value can be set using the `COALESCE` function. For example, `SELECT COALESCE(column_name, 0) FROM table_name;`. See [PostgreSQL documentation](https://www.postgresql.org/docs/current/functions-conditional.html#FUNCTIONS-COALESCE-NVL-IFNULL) for more information on the `COALESCE` function. + This is an example of using a full connection string with `AIRFLOW_CONN_AIRFLOW_DB` set as `postgresql://test@localhost`: ```yaml diff --git a/content/docs/2.15/scalers/postgresql.md b/content/docs/2.15/scalers/postgresql.md index eb3147e73..51b9b9194 100644 --- a/content/docs/2.15/scalers/postgresql.md +++ b/content/docs/2.15/scalers/postgresql.md @@ -34,6 +34,10 @@ Finally, a user inserts a query that returns the desired value. - `targetQueryValue` - A threshold that is used as `targetValue` or `targetAverageValue` (depending on the trigger metric type) in HPA. (This value can be a float) - `activationTargetQueryValue` - Target value for activating the scaler. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds).(Default: `0`, Optional, This value can be a float) + +> Note that the query must return a single integer value. If the query has a possibility of returning `null`, a default value can be set using the `COALESCE` function. For example, `SELECT COALESCE(column_name, 0) FROM table_name;`. See [PostgreSQL documentation](https://www.postgresql.org/docs/current/functions-conditional.html#FUNCTIONS-COALESCE-NVL-IFNULL) for more information on the `COALESCE` function. + + This is an example of using a full connection string with `AIRFLOW_CONN_AIRFLOW_DB` set as `postgresql://test@localhost`: ```yaml diff --git a/content/docs/2.2/scalers/postgresql.md b/content/docs/2.2/scalers/postgresql.md index be36e965b..e7ea26738 100644 --- a/content/docs/2.2/scalers/postgresql.md +++ b/content/docs/2.2/scalers/postgresql.md @@ -34,6 +34,8 @@ Finally, a user inserts a query that returns the desired value. - `targetQueryValue` - A threshold that is used as `targetAverageValue` in HPA. - `metricName` - Name to assign to the metric. If not set KEDA will generate a name based on either the connection string if set or the db name. If using more than one trigger it is required that all metricNames be unique. (Optional) +> Note that the query must return a single integer value. If the query has a possibility of returning `null`, a default value can be set using the `COALESCE` function. For example, `SELECT COALESCE(column_name, 0) FROM table_name;`. See [PostgreSQL documentation](https://www.postgresql.org/docs/current/functions-conditional.html#FUNCTIONS-COALESCE-NVL-IFNULL) for more information on the `COALESCE` function. + This is an example of using a full connection string with `AIRFLOW_CONN_AIRFLOW_DB` set as `postgresql://test@localhost`: ```yaml diff --git a/content/docs/2.3/scalers/postgresql.md b/content/docs/2.3/scalers/postgresql.md index be36e965b..e7ea26738 100644 --- a/content/docs/2.3/scalers/postgresql.md +++ b/content/docs/2.3/scalers/postgresql.md @@ -34,6 +34,8 @@ Finally, a user inserts a query that returns the desired value. - `targetQueryValue` - A threshold that is used as `targetAverageValue` in HPA. - `metricName` - Name to assign to the metric. If not set KEDA will generate a name based on either the connection string if set or the db name. If using more than one trigger it is required that all metricNames be unique. (Optional) +> Note that the query must return a single integer value. If the query has a possibility of returning `null`, a default value can be set using the `COALESCE` function. For example, `SELECT COALESCE(column_name, 0) FROM table_name;`. See [PostgreSQL documentation](https://www.postgresql.org/docs/current/functions-conditional.html#FUNCTIONS-COALESCE-NVL-IFNULL) for more information on the `COALESCE` function. + This is an example of using a full connection string with `AIRFLOW_CONN_AIRFLOW_DB` set as `postgresql://test@localhost`: ```yaml diff --git a/content/docs/2.4/scalers/postgresql.md b/content/docs/2.4/scalers/postgresql.md index be36e965b..e7ea26738 100644 --- a/content/docs/2.4/scalers/postgresql.md +++ b/content/docs/2.4/scalers/postgresql.md @@ -34,6 +34,8 @@ Finally, a user inserts a query that returns the desired value. - `targetQueryValue` - A threshold that is used as `targetAverageValue` in HPA. - `metricName` - Name to assign to the metric. If not set KEDA will generate a name based on either the connection string if set or the db name. If using more than one trigger it is required that all metricNames be unique. (Optional) +> Note that the query must return a single integer value. If the query has a possibility of returning `null`, a default value can be set using the `COALESCE` function. For example, `SELECT COALESCE(column_name, 0) FROM table_name;`. See [PostgreSQL documentation](https://www.postgresql.org/docs/current/functions-conditional.html#FUNCTIONS-COALESCE-NVL-IFNULL) for more information on the `COALESCE` function. + This is an example of using a full connection string with `AIRFLOW_CONN_AIRFLOW_DB` set as `postgresql://test@localhost`: ```yaml diff --git a/content/docs/2.5/scalers/postgresql.md b/content/docs/2.5/scalers/postgresql.md index 2ccdb8cf0..e0caf3a67 100644 --- a/content/docs/2.5/scalers/postgresql.md +++ b/content/docs/2.5/scalers/postgresql.md @@ -34,6 +34,8 @@ Finally, a user inserts a query that returns the desired value. - `targetQueryValue` - A threshold that is used as `targetAverageValue` in HPA. - `metricName` - Name to assign to the metric. If not set KEDA will generate a name based on either the connection string if set or the db name. If using more than one trigger it is required that all metricNames be unique. (Optional) +> Note that the query must return a single integer value. If the query has a possibility of returning `null`, a default value can be set using the `COALESCE` function. For example, `SELECT COALESCE(column_name, 0) FROM table_name;`. See [PostgreSQL documentation](https://www.postgresql.org/docs/current/functions-conditional.html#FUNCTIONS-COALESCE-NVL-IFNULL) for more information on the `COALESCE` function. + This is an example of using a full connection string with `AIRFLOW_CONN_AIRFLOW_DB` set as `postgresql://test@localhost`: ```yaml diff --git a/content/docs/2.6/scalers/postgresql.md b/content/docs/2.6/scalers/postgresql.md index 2ccdb8cf0..e0caf3a67 100644 --- a/content/docs/2.6/scalers/postgresql.md +++ b/content/docs/2.6/scalers/postgresql.md @@ -34,6 +34,8 @@ Finally, a user inserts a query that returns the desired value. - `targetQueryValue` - A threshold that is used as `targetAverageValue` in HPA. - `metricName` - Name to assign to the metric. If not set KEDA will generate a name based on either the connection string if set or the db name. If using more than one trigger it is required that all metricNames be unique. (Optional) +> Note that the query must return a single integer value. If the query has a possibility of returning `null`, a default value can be set using the `COALESCE` function. For example, `SELECT COALESCE(column_name, 0) FROM table_name;`. See [PostgreSQL documentation](https://www.postgresql.org/docs/current/functions-conditional.html#FUNCTIONS-COALESCE-NVL-IFNULL) for more information on the `COALESCE` function. + This is an example of using a full connection string with `AIRFLOW_CONN_AIRFLOW_DB` set as `postgresql://test@localhost`: ```yaml diff --git a/content/docs/2.7/scalers/postgresql.md b/content/docs/2.7/scalers/postgresql.md index 6342cebf8..1d2e88df3 100644 --- a/content/docs/2.7/scalers/postgresql.md +++ b/content/docs/2.7/scalers/postgresql.md @@ -34,6 +34,8 @@ Finally, a user inserts a query that returns the desired value. - `targetQueryValue` - A threshold that is used as `targetValue` or `targetAverageValue` (depending on the trigger metric type) in HPA. - `metricName` - Name to assign to the metric. If not set KEDA will generate a name based on either the connection string if set or the db name. If using more than one trigger it is required that all metricNames be unique. (Optional) +> Note that the query must return a single integer value. If the query has a possibility of returning `null`, a default value can be set using the `COALESCE` function. For example, `SELECT COALESCE(column_name, 0) FROM table_name;`. See [PostgreSQL documentation](https://www.postgresql.org/docs/current/functions-conditional.html#FUNCTIONS-COALESCE-NVL-IFNULL) for more information on the `COALESCE` function. + This is an example of using a full connection string with `AIRFLOW_CONN_AIRFLOW_DB` set as `postgresql://test@localhost`: ```yaml diff --git a/content/docs/2.8/scalers/postgresql.md b/content/docs/2.8/scalers/postgresql.md index 10dffca3f..ab963e4b5 100644 --- a/content/docs/2.8/scalers/postgresql.md +++ b/content/docs/2.8/scalers/postgresql.md @@ -35,6 +35,8 @@ Finally, a user inserts a query that returns the desired value. - `activationTargetQueryValue` - Target value for activating the scaler. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds).(Default: `0`, Optional, This value can be a float) - `metricName` - Name to assign to the metric. If not set KEDA will generate a name based on either the connection string if set or the db name. If using more than one trigger it is required that all metricNames be unique. (Optional) +> Note that the query must return a single integer value. If the query has a possibility of returning `null`, a default value can be set using the `COALESCE` function. For example, `SELECT COALESCE(column_name, 0) FROM table_name;`. See [PostgreSQL documentation](https://www.postgresql.org/docs/current/functions-conditional.html#FUNCTIONS-COALESCE-NVL-IFNULL) for more information on the `COALESCE` function. + This is an example of using a full connection string with `AIRFLOW_CONN_AIRFLOW_DB` set as `postgresql://test@localhost`: ```yaml diff --git a/content/docs/2.9/scalers/postgresql.md b/content/docs/2.9/scalers/postgresql.md index 10dffca3f..ab963e4b5 100644 --- a/content/docs/2.9/scalers/postgresql.md +++ b/content/docs/2.9/scalers/postgresql.md @@ -35,6 +35,8 @@ Finally, a user inserts a query that returns the desired value. - `activationTargetQueryValue` - Target value for activating the scaler. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds).(Default: `0`, Optional, This value can be a float) - `metricName` - Name to assign to the metric. If not set KEDA will generate a name based on either the connection string if set or the db name. If using more than one trigger it is required that all metricNames be unique. (Optional) +> Note that the query must return a single integer value. If the query has a possibility of returning `null`, a default value can be set using the `COALESCE` function. For example, `SELECT COALESCE(column_name, 0) FROM table_name;`. See [PostgreSQL documentation](https://www.postgresql.org/docs/current/functions-conditional.html#FUNCTIONS-COALESCE-NVL-IFNULL) for more information on the `COALESCE` function. + This is an example of using a full connection string with `AIRFLOW_CONN_AIRFLOW_DB` set as `postgresql://test@localhost`: ```yaml