pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Postgres DBA <postgres@nest.bistbn.com>
To: SQL Mailing List <pgsql-sql@postgreSQL.org>
Subject: CREATE RULE question
Date: Tue, 15 Dec 1998 10:02:54 +0200 (IST)
Message-ID: <Pine.BSF.4.02.9812151002260.6120-100000@nest.bistbn.com> (raw)

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.





view thread (2+ messages)  latest in thread

Message-ID: <Pine.BSF.4.02.9812151002260.6120-100000@nest.bistbn.com>
Permalink:  ../Pine.BSF.4.02.9812151002260.6120-100000@nest.bistbn.com/
Also on:    postgresql.org/message-id/Pine.BSF.4.02.9812151002260.6120-100000@nest.bistbn.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: postgres@nest.bistbn.com
  Subject: Re: CREATE RULE question
  In-Reply-To: <Pine.BSF.4.02.9812151002260.6120-100000@nest.bistbn.com>
  References: <Pine.BSF.4.02.9812151002260.6120-100000@nest.bistbn.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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