From: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> |
---|---|
To: | stan <stanb(at)panix(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org |
Subject: | Re: A question about rules |
Date: | 2020-01-18 16:56:06 |
Message-ID: | ea5d5d07-4167-6933-9862-eb3d9d1fa996@aklaver.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 1/18/20 8:53 AM, stan wrote:
> So, I just discovered the rules system. As I understand it, it can be used
> to rewrite queries before they are passed to the query processor.
>
> I was wondering if I could use this to resolve a long standing frustration
> of mine. I often need to declare a column as NON NULL, and create a
> trigger/function to auto populate it with something more complex than a
> simple sequence. This need arises fairly often for me, and I would like to
> come up with a good way to implement this.
Stay away from rules, they will only drive you to distraction. Stick
with triggers they are a lot easier to understand and implement.
>
> Sorry for such a newbie question.
>
--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Adrian Klaver | 2020-01-19 16:52:36 | Re: A question about rules |
Previous Message | stan | 2020-01-18 16:53:25 | A question about rules |