From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kyle <kyle@actarg.com>
Cc: Jan Wieck <janwieck@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Rule not invoked in 7.1
Date: Thu, 25 Jan 2001 22:35:46 -0500
Message-ID: <28329.980480146@sss.pgh.pa.us> (raw)
In-Reply-To: <3A706208.AD6AB9@actarg.com>
References: <200101251321.IAA02253@jupiter.greatbridge.com>
<3A706208.AD6AB9@actarg.com>
Kyle <kyle@actarg.com> writes:
> If someone happens to know the primary key of a record they should not be
> able to access, and they try to update it, I would like the backend to
> ignore the query (or better yet, raise an exception but I haven't figured
> out how to do that). If the status is correct, the update should proceed.
This might be better done with a trigger than a rule. For one thing,
a trigger can easily raise an exception. MHO is that rules are good
when you need to update multiple rows in other tables when certain
things happen. If you just want to validate or twiddle an individual
tuple as it's inserted/updated, a trigger is a good bet.
regards, tom lane
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: tgl@sss.pgh.pa.us, kyle@actarg.com, janwieck@yahoo.com
Subject: Re: Rule not invoked in 7.1
In-Reply-To: <28329.980480146@sss.pgh.pa.us>
References: <200101251321.IAA02253@jupiter.greatbridge.com> <3A706208.AD6AB9@actarg.com> <28329.980480146@sss.pgh.pa.us>
* 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