pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: JuanCri <juancri@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Re: Is it possible to redirect an update/insert/delete to a different table?
Date: 19 Nov 2005 22:43:33 -0800
Message-ID: <1132469013.246334.171700@g49g2000cwa.googlegroups.com> (raw)
In-Reply-To: <ECOWS06MsMkXWNcu9mt0001b868@smtp-out6.blueyonder.co.uk>
References: <ECOWS06MsMkXWNcu9mt0001b868@smtp-out6.blueyonder.co.uk>

I don't know what do you mean... because if you want to insert to other
table.. you can create a rule like this

CREATE RULE myrule AS ON INSERT
TO mytable
DO INSTEAD INSERT INTO myothertable VALUES (NEW.col1, NEW.col2,
NEW.col3);

that will work for all inserts.. I think the problem will be the
SELECT, right?... well.. that's solved if "mytable" is a view of SELECT
* FROM myothertable..

Juan C. Olivares
www.juancri.com




view thread (12+ messages)  latest in thread

Message-ID: <1132469013.246334.171700@g49g2000cwa.googlegroups.com>
Permalink:  ../1132469013.246334.171700@g49g2000cwa.googlegroups.com/
Also on:    postgresql.org/message-id/1132469013.246334.171700@g49g2000cwa.googlegroups.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: juancri@gmail.com
  Subject: Re: Is it possible to redirect an update/insert/delete to a different table?
  In-Reply-To: <1132469013.246334.171700@g49g2000cwa.googlegroups.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