diff --git a/.idea/runConfigurations/Test_All_SQL.xml b/.idea/runConfigurations/Test_All_SQL.xml
index a1dd142..f2f182f 100644
--- a/.idea/runConfigurations/Test_All_SQL.xml
+++ b/.idea/runConfigurations/Test_All_SQL.xml
@@ -52,6 +52,7 @@
+
diff --git a/src/main/resources/sql/functions/opinion/find_opinions.sql b/src/main/resources/sql/functions/opinion/find_opinions.sql
new file mode 100644
index 0000000..333fdcc
--- /dev/null
+++ b/src/main/resources/sql/functions/opinion/find_opinions.sql
@@ -0,0 +1,19 @@
+create or replace function find_opinions(out resource json)
+ language plpgsql as
+$$
+begin
+ select json_agg(t)
+ into resource
+ from (
+ select ol.*
+ from opinion_list ol
+ where ol.deleted_at <= now()
+ or ol.deleted_at is null
+ order by ol.name
+ ) t;
+end;
+$$;
+
+-- drop function if exists find_opinions();
+
+-- select find_opinions();
\ No newline at end of file
diff --git a/src/test/sql/opinion.sql b/src/test/sql/opinion.sql
index bba6e80..78a44de 100644
--- a/src/test/sql/opinion.sql
+++ b/src/test/sql/opinion.sql
@@ -93,6 +93,10 @@ begin
from find_citizen_opinions_by_target_ids(_citizen_id, array[(created_article->>'id')::uuid]) o),
'The first opinion must have a name';
+ assert(
+ select find_opinions()#>>'{0, name}' = 'Opinion1'
+ ), 'find_opinions mst be return all opinions';
+
-- delete vote and context
delete from opinion;
delete from opinion_list;