Document DELETE/UPDATE command tag vs triggers

Lists: pgsql-docs
From: Marti Raudsepp <marti(at)juffo(dot)org>
To: pgsql-docs <pgsql-docs(at)postgresql(dot)org>
Subject: Document DELETE/UPDATE command tag vs triggers
Date: 2011-09-17 19:43:53
Message-ID: CABRT9RAOE67OKF55n9+3ixw6-RiHhcvAUt2K-e49PUB0oZ8uWg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-docs

Hi list,

Currently the documentation for DELETE and UPDATE doesn't mention that
the number returned in the command tag is affected by triggers which
may suppress the change.

Worse, it currently states "If count is 0, no rows matched the
condition" which is incorrect -- the condition may have matched rows,
but the trigger might be suppressing the updates.

The new text says:

The <replaceable class="parameter">count</replaceable> is the number
of rows updated, including matched rows whose values did not change.
Note that the number may be less than the number of rows that matched
the <replaceable class="parameter">condition</replaceable> when
updates were suppressed by a <literal>BEFORE UPDATE</> trigger. If
<replaceable class="parameter">count</replaceable> is 0, no rows were
updated by the query (this is not considered an error).

Patch attached.

Regards,
Marti

Attachment Content-Type Size
0001-Document-DELETE-UPDATE-command-tag-vs-triggers.patch text/x-patch 2.4 KB

From: Marti Raudsepp <marti(at)juffo(dot)org>
To: pgsql-docs <pgsql-docs(at)postgresql(dot)org>
Subject: Re: Document DELETE/UPDATE command tag vs triggers
Date: 2011-09-25 13:12:26
Message-ID: CABRT9RCwEpMmn9qXw7LDVbQOsy8P98imA387vPj-4-tOh+c=Vw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-docs

On Sat, Sep 17, 2011 at 22:43, Marti Raudsepp <marti(at)juffo(dot)org> wrote:
> Currently the documentation for DELETE and UPDATE doesn't mention that
> the number returned in the command tag is affected by triggers which
> may suppress the change.

Bump! What's the right procedure for submitting documentation patches?
The CommitFest app doesn't have a "documentation" category.

Regards,
Marti


From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Marti Raudsepp <marti(at)juffo(dot)org>
Cc: pgsql-docs <pgsql-docs(at)postgresql(dot)org>
Subject: Re: Document DELETE/UPDATE command tag vs triggers
Date: 2011-09-25 13:35:20
Message-ID: 4E7F2E18.9050908@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-docs

On 25.09.2011 16:12, Marti Raudsepp wrote:
> Bump! What's the right procedure for submitting documentation patches?
> The CommitFest app doesn't have a "documentation" category.

Feel free to add one. The categories, or topics, are editable: click on
the "CommitFest Topics" link near the top-right corner, next to the "New
Patch" link. Then "New Topic".

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Marti Raudsepp <marti(at)juffo(dot)org>, pgsql-docs <pgsql-docs(at)postgresql(dot)org>
Subject: Re: Document DELETE/UPDATE command tag vs triggers
Date: 2011-10-10 16:58:00
Message-ID: CA+TgmoZqiMDrWJOR=T63SL=DoC-KXBjfnz0TOaGAZFggb-Qd-Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-docs

On Sun, Sep 25, 2011 at 9:35 AM, Heikki Linnakangas
<heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
> On 25.09.2011 16:12, Marti Raudsepp wrote:
>>
>> Bump! What's the right procedure for submitting documentation patches?
>> The CommitFest app doesn't have a "documentation" category.
>
> Feel free to add one. The categories, or topics, are editable: click on the
> "CommitFest Topics" link near the top-right corner, next to the "New Patch"
> link. Then "New Topic".

Committed.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Marti Raudsepp <marti(at)juffo(dot)org>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-docs <pgsql-docs(at)postgresql(dot)org>
Subject: Re: Document DELETE/UPDATE command tag vs triggers
Date: 2011-10-12 08:39:05
Message-ID: CABRT9RDqwQXjjYRhKPK23bJzAHfMNKXcxxcQ80qa=j9d3zOOrg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-docs

On Mon, Oct 10, 2011 at 19:58, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> Committed.

Thanks!

Do you think it should be backported to earlier versions too? As it
stands, the documentation is misleading.

Regards,
Marti


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Marti Raudsepp <marti(at)juffo(dot)org>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-docs <pgsql-docs(at)postgresql(dot)org>
Subject: Re: Document DELETE/UPDATE command tag vs triggers
Date: 2011-10-12 16:48:22
Message-ID: CA+TgmobLXHi9yu-JjSMceojxO+idK8XjdiNm4x1XB0bSL7En1Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-docs

On Wed, Oct 12, 2011 at 4:39 AM, Marti Raudsepp <marti(at)juffo(dot)org> wrote:
> On Mon, Oct 10, 2011 at 19:58, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>> Committed.
>
> Thanks!
>
> Do you think it should be backported to earlier versions too? As it
> stands, the documentation is misleading.

Well, I committed about five doc patches that day, and I had to decide
for each one whether it was worth back-patching, and if so whether it
was worth back-patching all the way or just to 9.1. (We typically
back-patch things to all applicable versions or not at all, but for
doc changes sometimes we go back exactly one release so that it will
make its way onto the most current version of the web site docs a
little bit more quickly.) I decided against back-patching this one,
on the theory that we make many documentation improvements over the
course of every major release cycle, and back-patching all of them
creates more work for translators than can really be justified by the
small number of people who read older versions of the documentation.
It's an arguable point, of course, and I wouldn't have objected if
someone else had chosen differently.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Marti Raudsepp <marti(at)juffo(dot)org>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-docs <pgsql-docs(at)postgresql(dot)org>
Subject: Re: Document DELETE/UPDATE command tag vs triggers
Date: 2011-10-12 17:57:10
Message-ID: 201110121757.p9CHvAn15219@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-docs

Robert Haas wrote:
> On Wed, Oct 12, 2011 at 4:39 AM, Marti Raudsepp <marti(at)juffo(dot)org> wrote:
> > On Mon, Oct 10, 2011 at 19:58, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> >> Committed.
> >
> > Thanks!
> >
> > Do you think it should be backported to earlier versions too? As it
> > stands, the documentation is misleading.
>
> Well, I committed about five doc patches that day, and I had to decide
> for each one whether it was worth back-patching, and if so whether it
> was worth back-patching all the way or just to 9.1. (We typically
> back-patch things to all applicable versions or not at all, but for
> doc changes sometimes we go back exactly one release so that it will
> make its way onto the most current version of the web site docs a
> little bit more quickly.) I decided against back-patching this one,
> on the theory that we make many documentation improvements over the
> course of every major release cycle, and back-patching all of them
> creates more work for translators than can really be justified by the
> small number of people who read older versions of the documentation.
> It's an arguable point, of course, and I wouldn't have objected if
> someone else had chosen differently.

I agree with your analysis.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +


From: Marti Raudsepp <marti(at)juffo(dot)org>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-docs <pgsql-docs(at)postgresql(dot)org>
Subject: Re: Document DELETE/UPDATE command tag vs triggers
Date: 2011-10-12 18:27:50
Message-ID: CABRT9RCPMsiYgr6pUsHzt+d-V4krUhd+Hjrp4Wap62dQTKHxxw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-docs

On Wed, Oct 12, 2011 at 19:48, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> Well, I committed about five doc patches that day, and I had to decide
> for each one whether it was worth back-patching,

> I decided against back-patching this one

Sounds fair.

For what it's worth, I wasn't doubting your judgement. Just that it
wasn't clear to me whether you had considered backpatching or not.

Regards,
Marti


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Marti Raudsepp <marti(at)juffo(dot)org>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-docs <pgsql-docs(at)postgresql(dot)org>
Subject: Re: Document DELETE/UPDATE command tag vs triggers
Date: 2011-10-12 19:34:30
Message-ID: CA+Tgmobwn050-5meSnGRTkSVAZj=2wdgzd_XdiXyC7psd-p6JA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-docs

On Wed, Oct 12, 2011 at 2:27 PM, Marti Raudsepp <marti(at)juffo(dot)org> wrote:
> On Wed, Oct 12, 2011 at 19:48, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>> Well, I committed about five doc patches that day, and I had to decide
>> for each one whether it was worth back-patching,
>
>> I decided against back-patching this one
>
> Sounds fair.
>
> For what it's worth, I wasn't doubting your judgement. Just that it
> wasn't clear to me whether you had considered backpatching or not.

Hmm, I probably could've clarified that in my email instead of just
saying "Committed". Will try to remember that next time.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company