Document DELETE/UPDATE command tag vs triggers

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
Thread:
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

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Robert Haas 2011-09-19 19:01:55 Re: create foreign table
Previous Message Ray Stell 2011-09-15 16:51:57 Re: create foreign table