Received: from ll.mit.edu (LLMAIL.LL.MIT.EDU [129.55.12.40]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f1SL19x83882 for ; Wed, 28 Feb 2001 16:01:09 -0500 (EST) (envelope-from gry@ll.mit.edu) Received: (from smtp@localhost) by ll.mit.edu (8.8.8/8.8.8) id QAA21000 for ; Wed, 28 Feb 2001 16:01:06 -0500 (EST) Received: from pen.llan.ll.mit.edu( ), claiming to be "pen.llan" via SMTP by llpost, id smtpdAAAWUa4qM; Wed Feb 28 16:00:44 2001 Received: from localhost (localhost [[UNIX: localhost]]) by pen.llan (8.9.3/8.9.3) id QAA10987 for pgsql-sql@postgresql.org; Wed, 28 Feb 2001 16:00:44 -0500 From: George Young To: pgsql-sql@postgresql.org Subject: plpgsql notify trigger Date: Wed, 28 Feb 2001 14:30:07 -0500 X-Mailer: KMail [version 1.0.17] Content-Type: text/plain MIME-Version: 1.0 Message-Id: <01022816004403.01482@pen> Content-Transfer-Encoding: 8bit X-Archive-Number: 200102/430 X-Sequence-Number: 1635 [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