postgres function pg_notify(unknown, text) does not exist

Viewed 3069

am using pg_notify to get notification if any new inserted record in my table (notifications) i wrote a the following function which will perform the notification:

   CREATE FUNCTION notify_trigger() RETURNS trigger AS $$DECLARE
   BEGIN
   select pg_notify('watcher', 'id,' || NEW.id );
   RETURN new;
  END;
  $$ LANGUAGE plpgsql;

and the trigger to fire this newly created function when a insert-query is performed:

  CREATE TRIGGER watched_table_trigger AFTER INSERT ON notificationsFOR EACH ROW EXECUTE PROCEDURE notify_trigger();

but am trying to insert a record in the 'notifications' table am getting this:

  ERROR:  function pg_notify(unknown, text) does not exist
  LINE 1: select pg_notify('watcher', 'id,' ||  $1  )
           ^
  HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
0 Answers
Related