Postgresql – Perform update and raise notice in Postgres Function

functionspostgresqlpostgresql-9.6trigger

I'm trying to add a notice (or something similar) to a function that is executed on update by a trigger in PostgreSQL 9.6 db. I want to let the user who edited the table that something happened.
I don't know is "NOTICE" is the proper RAISE (Why not "INFO"?).

The central question is: how I can add the raise notice argument after the update?

Best Answer

The problem can be, that level for messages is too high

so try this appproach

CREATE TABLE id ( "id1" INT)
INSERT INTO id VALUES (1)
1 rows affected
do
$$
declare
  newnumer int = 90;
begin
   
  UPDATE id SET id1 =  newnumer WHERE id1 = 1;
SET client_min_messages TO INFO;
  raise info   '"NOTICE" is the proper RAISE (Why not "INFO"?)' ;
        -- catch notification
      
end;
$$
language plpgsql;
SELECT * FROM id;
| id1 |
| --: |
|  90 |

db<>fiddle here