From: Andy Ballingall <andy@areyoulocal.co.uk>
To: 'Peter Eisentraut' <peter_e@gmx.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: Is it possible to redirect an update/insert/delete to a different table?
Date: Sun, 20 Nov 2005 15:28:10 -0000
Message-ID: <ECOWS02MmWL9vVmguzY0004c4cf@smtp-out2.blueyonder.co.uk> (raw)
In-Reply-To: <200511201207.01114.peter_e@gmx.net>
Hello Peter,
I'm glad it's possible, but I can't see how from the documentation.
Say if I have a table called 'apples' and a table called 'pears'.
What would the rule look like that would remap all updates on apples so that
they were applied to pears instead?
Thanks,
Andy
-------------------------
Andy Ballingall wrote:
> I've looked through rules, and as far as I can make out, they are
> only useful for explicit actions. I'm looking for something that
> behaves as though it simply substitutes the table name for a
> different table name before executing the command, no matter what the
> command looks like.
You can write a couple of rules for that.
--
Peter Eisentraut
http://developer.postgresql.org/~petere/
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.4/176 - Release Date: 20/11/2005
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: andy@areyoulocal.co.uk, peter_e@gmx.net
Subject: Re: Is it possible to redirect an update/insert/delete to a different table?
In-Reply-To: <ECOWS02MmWL9vVmguzY0004c4cf@smtp-out2.blueyonder.co.uk>
* 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