Re: create rule ... as on insert

From: Janning Vygen <vygen(at)gmx(dot)de>
To: pgsql-general(at)postgresql(dot)org
Cc: Omachonu Ogali <missnglnk(at)informationwave(dot)net>
Subject: Re: create rule ... as on insert
Date: 2005-06-24 15:42:38
Message-ID: 200506241742.38480.vygen@gmx.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Am Freitag, 24. Juni 2005 17:05 schrieb Omachonu Ogali:
> I'm using PostgreSQL 7.4.2, and I'm having a little issue with rules.
>
> I created a rule to watch for any inserts to table XYZ, and registered
> a listener. But as I simply do a select on the table, I receive several
> notifications when nothing has been inserted into the table.
[...]
> I'm the only one with full rights to this table, and the only one that
> is currently working on this database. There is another rule that I've
> created (and is currently active), that does inserts into xyz from
> another table, but as you can see below, there are no new inserts.
>
> db=# select * from xyz;
> ( 2 rows)

there is no need that something is really inserted i guess. from the docs:
"Presently, if a rule action contains a NOTIFY command, the NOTIFY command
will be executed unconditionally, that is, the NOTIFY will be issued even if
there are not any rows that the rule should apply to. For example, in

CREATE RULE notify_me AS ON UPDATE TO mytable DO NOTIFY mytable;

UPDATE mytable SET name = 'foo' WHERE id = 42;
" [sql-createrule.html]

So maybe your other rule is trying to insert nothing like the UPDATE command
in the example above.

kind regards,
janning

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-06-24 16:00:52 Re: PostgreSQL Certification
Previous Message Joshua D. Drake 2005-06-24 15:42:00 Re: PostgreSQL Certification