Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f5TCDZa14825 for ; Fri, 29 Jun 2001 08:13:35 -0400 (EDT) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f5MJVga53229 for ; Fri, 22 Jun 2001 15:31:42 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f5MJHrH44689 for pgsql-sql@postgresql.org; Fri, 22 Jun 2001 15:17:53 -0400 (EDT) (envelope-from news) From: "Jeff Boes" X-Newsgroups: comp.databases.postgresql.sql Subject: NOTIFY "string" from rule Date: Fri, 22 Jun 2001 15:18:31 -0400 Organization: Nexcerpt, Inc. Lines: 29 Message-ID: <9h05l0$1bke$1@news.tht.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: scrappy@hub.org User-Agent: Pan/0.9.7 (Unix) To: pgsql-sql@postgresql.org X-Archive-Number: 200106/466 X-Sequence-Number: 3769 Say my table looks like: CREATE TABLE foo(status char(5), name char(5)); and I want to have a rule that does this: CREATE RULE nf_foo AS ON INSERT TO foo DO NOTIFY new.status || '_' || new.name; Any hints? My first attempt was to write a function: CREATE FUNCTION bar(foo) RETURNS TEXT AS 'SELECT $1.status || ''_'' || $1.name;' LANGUAGE 'sql'; and then change the last line of the rule to NOTIFY bar(new); but no luck. I would like to avoid writing a bunch of rules to process each combination of 'status' and 'name' (at least they're each a limited set!). -- Jeff Boes vox 616.226.9550 Database Engineer fax 616.349.9076 Nexcerpt, Inc. jboes@nexcerpt.com