From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Ken Tanzer <ken.tanzer@gmail.com>
Cc: basti <mailinglist@unix-solution.de>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Conditional INSERT
Date: Fri, 15 Mar 2019 17:41:20 -0700
Message-ID: <18a75d30-85f4-becd-7a78-43b5315fd298@aklaver.com> (raw)
In-Reply-To: <CAD3a31WC87GcxV=_cJwzoppCjzAe61CZh5XDf5J-xOSi8m4sXw@mail.gmail.com>
References: <68951fae-3281-c9ad-09b7-205e0bb1c5ae@unix-solution.de>
<CACxu=vKcVZdjsmMQyGf2tAcVAt8vyz2X1b+ynPb=_==AATjbVA@mail.gmail.com>
<CAHOFxGr3WCD1Kb0mL8aXiRHyYpOaV98uzF_pcJA_ALF4V0qhjA@mail.gmail.com>
<1ebb57da-c34b-6581-ea33-bdf78f6990f8@unix-solution.de>
<53dc55ae-506f-2aed-ea80-50f0978837ab@aklaver.com>
<CAD3a31U5YB8vd4CyKWrbuZoqgiE58SCdOUck6ju9b_yvrZ9Daw@mail.gmail.com>
<b6316de2-1072-0724-7149-7e0ea4feaaf9@aklaver.com>
<CAD3a31WC87GcxV=_cJwzoppCjzAe61CZh5XDf5J-xOSi8m4sXw@mail.gmail.com>
On 3/15/19 5:19 PM, Ken Tanzer wrote:
>
>
> On Fri, Mar 15, 2019 at 4:42 PM Adrian Klaver <adrian.klaver@aklaver.com
> <mailto:adrian.klaver@aklaver.com>> wrote:
> OK, and thanks for the info. I've gleaned that rules are not
> "deprecated" in the sense that they are slated for removal, but they are
> rather discouraged. Since that's the case, wouldn't it make sense to
> warn users about this? That might keep them away from rules, and ease
> any eventual deprecation/transition issues you might have by lowering
> the number of "rules" in the wild.
Well then there is this section:
https://www.postgresql.org/docs/11/rules-views.html
So as was mentioned in thread I posted, until someone comes up with a
replacement they are not going away.
>
> In the section on "Rules vs. Triggers" (41.7), it doesn't even hint at
> this, and even says:
>
> /"For the things that can be implemented by both, which is best depends
> on the usage of the database."
> /
>
> There _is_ a nice CAUTION box in 41.4 ("Rules on Insert, Update and
> Delete"). I would suggest that something like that should go into Rules
> vs. Triggers, and then have a short caution box at the top of perhaps
> every Rule page (or at the very least for "CREATE RULE") that says
> something like "Rules are discouraged. You may be better off with
> Triggers instead. See <rules_v_triggers>."
>
> Just my two cents, but that might help more people be aware of the issue
> and avoid rules altogether.
I thought I remember there being something like in a older version of
the docs. I can't find it now, so it might be just my mind playing
tricks on me.
>
> Cheers,
> Ken
>
--
Adrian Klaver
adrian.klaver@aklaver.com
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-general@postgresql.org
Cc: adrian.klaver@aklaver.com, ken.tanzer@gmail.com, mailinglist@unix-solution.de
Subject: Re: Conditional INSERT
In-Reply-To: <18a75d30-85f4-becd-7a78-43b5315fd298@aklaver.com>
References: <68951fae-3281-c9ad-09b7-205e0bb1c5ae@unix-solution.de> <CACxu=vKcVZdjsmMQyGf2tAcVAt8vyz2X1b+ynPb=_==AATjbVA@mail.gmail.com> <CAHOFxGr3WCD1Kb0mL8aXiRHyYpOaV98uzF_pcJA_ALF4V0qhjA@mail.gmail.com> <1ebb57da-c34b-6581-ea33-bdf78f6990f8@unix-solution.de> <53dc55ae-506f-2aed-ea80-50f0978837ab@aklaver.com> <CAD3a31U5YB8vd4CyKWrbuZoqgiE58SCdOUck6ju9b_yvrZ9Daw@mail.gmail.com> <b6316de2-1072-0724-7149-7e0ea4feaaf9@aklaver.com> <CAD3a31WC87GcxV=_cJwzoppCjzAe61CZh5XDf5J-xOSi8m4sXw@mail.gmail.com> <18a75d30-85f4-becd-7a78-43b5315fd298@aklaver.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