From b214d022b6894e476188fc3b2e593c5d661d3df9 Mon Sep 17 00:00:00 2001 From: Julien Rouhaud Date: Fri, 22 Nov 2024 07:44:59 +0800 Subject: [PATCH] fix: Fix notifiation authorization check on pg13- Postgres 13 or lower don't have predefined roles, so we call unnest on an empty python array which is emitted as '{}'. This is ambiguous for postgres so we need to explicitly cast the value as an array of text, which works for both an empty array and a non empty array (which is emitted as ARRAY[...]). --- powa/dashboards.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powa/dashboards.py b/powa/dashboards.py index 7736f9f3..1a7e6c77 100644 --- a/powa/dashboards.py +++ b/powa/dashboards.py @@ -152,7 +152,7 @@ def notify_allowed(self): try: cur.execute( """WITH s(v) AS ( - SELECT unnest(%s) + SELECT unnest(%s::text[]) UNION ALL SELECT rolname FROM {powa}.powa_roles