plpgsql notify trigger

Поиск
Список
Период
Сортировка
От George Young
Тема plpgsql notify trigger
Дата
Msg-id 01022816004403.01482@pen
обсуждение исходный текст
Ответы Re: plpgsql notify trigger  (Yury Don <yura@vpcit.ru>)
Список pgsql-sql
[postgres 7.0.2, x86 linux]

I am trying to use a trigger to perform an sql 'notify' command.
I do something like:

CREATE FUNCTION run_changed() RETURNS opaque AS '  declare     nm text;  begin      nm := NEW.run_name;      notify nm
   return null;  end;        
 
' LANGUAGE 'plpgsql';

create trigger run_changed_tr after update on runs for each row      execute procedure run_changed();


BUT, when I update the table, I get:  ERROR:  parser: parse error at or near "$1"     

It looks like the *name* (or it's alias here: $1.run_name), not the *value* of the variable nm,
is passwd to the notify command.  Since notify only takes a name, not a string,
I don't see how to proceed.  

Is there some way in plsql to construct a string and have it executed in sql?

disappointed in plsql,George

--
George Young,  Rm. L-204        gry@ll.mit.edu
MIT Lincoln Laboratory
244 Wood St.
Lexington, Massachusetts  02420-9108    (781) 981-2756


В списке pgsql-sql по дате отправления:

Предыдущее
От: "Diehl, Jeffrey"
Дата:
Сообщение: RE: mysql's "replace into..."
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: mysql's "replace into..."