CREATE RULE question

From: Postgres DBA <postgres(at)nest(dot)bistbn(dot)com>
To: SQL Mailing List <pgsql-sql(at)postgreSQL(dot)org>
Subject: CREATE RULE question
Date: 1998-12-15 08:02:54
Message-ID: Pine.BSF.4.02.9812151002260.6120-100000@nest.bistbn.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi!
Is there any way to create rule with more than one action?
The syntax shown in psql help as well as appropriate man page
definitely show that it's possible:
CREATE RULE rule_name AS ON
[SELECT|UPDATE|DELETE|INSERT]
TO object [WHERE qual]
DO [INSTEAD] [action|NOTHING|[actions]];

but I can't do anything about it:
CREATE RULE proba_upd
AS ON update to proba
DO UPDATE proba SET dr_date = 'now'::text where id=OLD.id and
dr_date='infinity'
INSERT INTO proba VALUES (NEW.id, NEW.name)
;
ERROR: parser: parse error at or near "insert"

So, is that my fault, and I should place something between to queries or
that is just impossible?

Thanks in advance.
Aleksey.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Zsolt Varga 1998-12-15 08:23:55 Unix dateformat ?
Previous Message KOUL Christian 1998-12-15 07:41:17 command copy and type char(x)