Re: a misbehavior of partition row movement (?)

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: Rahila Syed <rahilasyed90(at)gmail(dot)com>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Arne Roland <A(dot)Roland(at)index(dot)de>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: a misbehavior of partition row movement (?)
Date: 2021-02-26 07:29:49
Message-ID: CA+HiwqHnU7KA7q=v2Foj39f6heoC2kEMX5BsHi0HyvrrwEBa8g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Rahila,

On Wed, Feb 24, 2021 at 3:07 PM Rahila Syed <rahilasyed90(at)gmail(dot)com> wrote:
>> > I think the documentation update is missing from the patches.
>>
>> Hmm, I don't think we document the behavior that is improved by the v3
>> patches as a limitation of any existing feature, neither of foreign
>> keys referencing partitioned tables nor of the update row movement
>> feature. So maybe there's nothing in the existing documentation that
>> is to be updated.
>>
>> However, the patch does add a new error message for a case that the
>> patch doesn't handle, so maybe we could document that as a limitation.
>> Not sure if in the Notes section of the UPDATE reference page which
>> has some notes on row movement or somewhere else. Do you have
>> suggestions?
>>
> You are right, I could not find any direct explanation of the impact of row movement during
> UPDATE on a referencing table in the PostgreSQL docs.
>
> The two documents that come close are either:

Thanks for looking those up.

> 1. https://www.postgresql.org/docs/13/trigger-definition.html .
> The para starting with "If an UPDATE on a partitioned table causes a row to move to another partition"
> However, this does not describe the behaviour of internal triggers which is the focus of this patch.

The paragraph does talk about a very related topic, but, like you, I
am not very excited about adding a line here about what we're doing
with internal triggers.

> 2. Another one like you mentioned, https://www.postgresql.org/docs/11/sql-update.html
> This has explanation for row movement behaviour for partitioned table but does not explain
> any impact of such behaviour on a referencing table.
> I think it is worth adding some explanation in this document. Thus, explaining
> impact on referencing tables here, as it already describes behaviour of
> UPDATE on a partitioned table.

ISTM the description of the case that will now be prevented seems too
obscure to make into a documentation line, but I tried. Please check.

--
Amit Langote
EDB: http://www.enterprisedb.com

Attachment Content-Type Size
v5-0001-Create-foreign-key-triggers-in-partitioned-tables.patch application/octet-stream 34.2 KB
v5-0002-Enforce-foreign-key-correctly-during-cross-partit.patch application/octet-stream 44.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Julien Rouhaud 2021-02-26 07:45:31 Re: REINDEX backend filtering
Previous Message Masahiko Sawada 2021-02-26 07:26:25 Re: a misbehavior of partition row movement (?)