pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
ERROR:  Conditional NOTIFY is not implemented
3+ messages / 3 participants
[nested] [flat]

* ERROR:  Conditional NOTIFY is not implemented
@ 2001-08-21 21:14 matthew.copeland@honeywell.com
  2001-08-21 23:45 ` Re: ERROR: Conditional NOTIFY is not implemented Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: matthew.copeland@honeywell.com @ 2001-08-21 21:14 UTC (permalink / raw)
  To: pgsql-admin


I have a set of rules that worked in 7.0.3 for async notification.  Those
same set of rules don't seem to be working under 7.1.2.  The rules look
like this.

CREATE RULE CONFIG_CHNG AS ON INSERT TO gs_config DO (NOTIFY CONFIG_CHANGE);
CREATE RULE CONFIG_CHNG AS ON UPDATE TO gs_config DO (NOTIFY CONFIG_CHANGE);
CREATE RULE CONFIG_CHNG AS ON DELETE TO gs_config DO (NOTIFY CONFIG_CHANGE);

Here is a look at what my session looks like.

bash# psql config
Welcome to psql, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help on internal slash commands
       \g or terminate with semicolon to execute query
       \q to quit

config=# insert into gs_config values ('Life','42');
INSERT 18842 1
config=# update gs_config set config_value='0' where config_name='Life';
ERROR:  Conditional NOTIFY is not implemented
config=# delete from gs_config where config_name='Life';
ERROR:  Conditional NOTIFY is not implemented
config=# \q


Obviously, this isn't what I desired to have happen.  :)  Anyone have any
ideas on either a way that I can get around this little feature?  I really
really need the async notification stuff.  

Thanks,
Matthew M. Copeland





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: ERROR: Conditional NOTIFY is not implemented
  2001-08-21 21:14 ERROR:  Conditional NOTIFY is not implemented matthew.copeland@honeywell.com
@ 2001-08-21 23:45 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2001-08-21 23:45 UTC (permalink / raw)
  To: matthew.copeland@honeywell.com; +Cc: pgsql-admin

matthew.copeland@honeywell.com writes:
> I have a set of rules that worked in 7.0.3 for async notification.  Those
> same set of rules don't seem to be working under 7.1.2.

They weren't really working right in 7.0 either, but they coincidentally
failed to crash.

I'd suggest using a trigger that does NOTIFY, instead.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* RE: ERROR:  Conditional NOTIFY is not implemented
@ 2001-08-22 15:31 Henshall, Stuart - WCP <SHenshall@westcountrypublications.co.uk>
  0 siblings, 0 replies; 3+ messages in thread

From: Henshall, Stuart - WCP @ 2001-08-22 15:31 UTC (permalink / raw)
  To: 'matthew.copeland@honeywell.com' <matthew.copeland@honeywell.com>; pgsql-admin

Off the top of my head:
Could you wrap it in a function:
CREATE FUNCTION rs_nt() RETURNS int4 AS '
BEGIN
RAISE NOTICE ''hello world'';
RETURN 0;
END;
' LANGUAGE 'plpgsql';
Then select this in the rule (  ie: DO (SELECT rs_nt())   )
Or:
CREATE FUNCTION rs_trig() RETURNS OPAQUE AS '
BEGIN
RAISE NOTICE ''hello world'';
RETURN NEW;
END;
' LANGUAGE 'plpgsql';
And execute it as a trigger function on INSERT/UPDATE (You'd have to replace
NEW with OLD for DELETE, OR make it an after trigger and return NULL).
There might be a way to RAISE without function overhead but I'm afraid I'm
not aware of it.
Hope this helps,
- Stuart

> -----Original Message-----
> From:	matthew.copeland@honeywell.com [SMTP:matthew.copeland@honeywell.com]
> Sent:	Tuesday, August 21, 2001 10:14 PM
> To:	PostgreSqlAdmin
> Subject:	ERROR:  Conditional NOTIFY is not implemented
> 
> 
> I have a set of rules that worked in 7.0.3 for async notification.  Those
> same set of rules don't seem to be working under 7.1.2.  The rules look
> like this.
> 
> CREATE RULE CONFIG_CHNG AS ON INSERT TO gs_config DO (NOTIFY
> CONFIG_CHANGE);
> CREATE RULE CONFIG_CHNG AS ON UPDATE TO gs_config DO (NOTIFY
> CONFIG_CHANGE);
> CREATE RULE CONFIG_CHNG AS ON DELETE TO gs_config DO (NOTIFY
> CONFIG_CHANGE);
> 
> Here is a look at what my session looks like.
> 
> bash# psql config
> Welcome to psql, the PostgreSQL interactive terminal.
> 
> Type:  \copyright for distribution terms
>        \h for help with SQL commands
>        \? for help on internal slash commands
>        \g or terminate with semicolon to execute query
>        \q to quit
> 
> config=# insert into gs_config values ('Life','42');
> INSERT 18842 1
> config=# update gs_config set config_value='0' where config_name='Life';
> ERROR:  Conditional NOTIFY is not implemented
> config=# delete from gs_config where config_name='Life';
> ERROR:  Conditional NOTIFY is not implemented
> config=# \q
> 
> 
> Obviously, this isn't what I desired to have happen.  :)  Anyone have any
> ideas on either a way that I can get around this little feature?  I really
> really need the async notification stuff.  
> 
> Thanks,
> Matthew M. Copeland
> 
> 



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2001-08-22 15:31 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-08-21 21:14 ERROR:  Conditional NOTIFY is not implemented matthew.copeland@honeywell.com
2001-08-21 23:45 ` Re: ERROR: Conditional NOTIFY is not implemented Tom Lane <tgl@sss.pgh.pa.us>
2001-08-22 15:31 RE: ERROR:  Conditional NOTIFY is not implemented Henshall, Stuart - WCP <SHenshall@westcountrypublications.co.uk>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox