pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Itai Zukerman <zukerman@math-hat.com>
To: pgsql-sql@postgresql.org
Subject: Re: Conditional rule?
Date: 27 Jul 2000 11:05:35 -0400
Message-ID: <87g0ov8vgg.fsf@matt.w80.math-hat.com> (raw)
References: <87k8e78yg9.fsf@matt.w80.math-hat.com>
	<003601bff7d9$18cdd610$74b5f8c2@wkst6>

> I.e. "On an insert to news, if new.publish is not null, insert the new
> post's id into news_unpublished.

How about:

CREATE RULE newsrule AS
ON INSERT TO news
DO
  INSERT INTO news_unpublished
  SELECT NEW.id
  WHERE NEW.publishtime IS NOT NULL

-itai



view thread (11+ messages)  latest in thread

Message-ID: <87g0ov8vgg.fsf@matt.w80.math-hat.com>
Permalink:  ../87g0ov8vgg.fsf@matt.w80.math-hat.com/
Also on:    postgresql.org/message-id/87g0ov8vgg.fsf@matt.w80.math-hat.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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: zukerman@math-hat.com
  Subject: Re: Conditional rule?
  In-Reply-To: <87g0ov8vgg.fsf@matt.w80.math-hat.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