From eca96030b8d9355050801531c7720926e02cdfe1 Mon Sep 17 00:00:00 2001 From: mauroseb Date: Thu, 12 Feb 2026 16:22:33 +0100 Subject: [PATCH] fix: adding missing whitespaces in queries There are missing whitespaces in some of the queries which make triggers errors when running against a PostgreSQL 17 database. Apparently due to a more stringent SQL parsing in that version. The following error in the DB logs was corrected by the changes at the time of associating a user to an organization: ```console ERROR: trailing junk after parameter at or near "$3WHERE" at character 62 STATEMENT: UPDATE groups SET last_updated_by= $1, updated_at= $2, name= $3WHERE| id= ``` Signed-off-by: Mauro Oddi --- .../apps/oc_chef_authz/priv/pgsql_statements.config | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/oc_erchef/apps/oc_chef_authz/priv/pgsql_statements.config b/src/oc_erchef/apps/oc_chef_authz/priv/pgsql_statements.config index 8d4301b9bb..8a18d5b3d6 100644 --- a/src/oc_erchef/apps/oc_chef_authz/priv/pgsql_statements.config +++ b/src/oc_erchef/apps/oc_chef_authz/priv/pgsql_statements.config @@ -74,7 +74,7 @@ " ($1, $2, $3, $4, $5, $6, $7, $8)">>}. {update_organization_by_id, <<"UPDATE orgs SET last_updated_by= $1, updated_at= $2, name= $3, full_name= $4" - "WHERE id= $5">>}. + " WHERE id= $5">>}. {delete_organization_by_id, <<"DELETE FROM orgs WHERE id= $1">>}. {find_organization_by_id, <<"SELECT id, authz_id, name, full_name, assigned_at, last_updated_by, created_at, updated_at" @@ -95,7 +95,7 @@ " ($1, $2, $3, $4, $5, $6, $7)">>}. {update_container_by_id, <<"UPDATE containers SET last_updated_by= $1, updated_at= $2, name= $3" - "WHERE id= $4">>}. + " WHERE id= $4">>}. {delete_container_by_id, <<"DELETE FROM containers WHERE id= $1">>}. {list_containers_for_org, <<"SELECT name FROM containers WHERE org_id= $1">>}. {list_groups_for_org, <<"SELECT name FROM groups WHERE org_id= $1">>}. @@ -109,7 +109,7 @@ " ($1, $2, $3, $4, $5, $6, $7)">>}. {update_group_by_id, <<"UPDATE groups SET last_updated_by= $1, updated_at= $2, name= $3" - "WHERE id= $4">>}. + " WHERE id= $4">>}. {delete_group_by_id, <<"DELETE FROM groups WHERE id= $1">>}. {list_policies_for_org, <<"SELECT name FROM policies WHERE org_id= $1">>}. @@ -123,7 +123,7 @@ " ($1, $2, $3, $4, $5)">>}. {update_policy_by_id, <<"UPDATE policies SET last_updated_by= $1, name = $2, policy_group=$3" - "WHERE id = $5">>}. + " WHERE id = $5">>}. {delete_policy_by_name_org_id, <<"DELETE FROM policies WHERE name= $1 AND org_id= $2">>}. {delete_policy_by_id, <<"DELETE FROM policies WHERE id= $1">>}.