Trigger tuple slotification (extracted from pluggable storage patch)

From: Amit Khandekar <amitdkhan(dot)pg(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Trigger tuple slotification (extracted from pluggable storage patch)
Date: 2018-11-19 09:30:44
Message-ID: CAJ3gD9fjpoPHSHB-Ufj7ciT8nV0JSA2gdJUdtxo-bMyPrpjk=Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

In [1], there was a plan to do the trigger tuple slotification
changes as a separate patch, and not include them in the pluggable
storage changes. I have come up with such a patch by extracting the
trigger-specific changes from the pluggable storage changes proposed
in [1]. I used this repository to extract the changes :
https://github.com/anarazel/postgres-pluggable-storage.git

Extracted changes from this commit :

commit 6066202a97c9a2d540fd2a2e5fd2cad22f307cd2
Author: Andres Freund <andres(at)anarazel(dot)de>
Date: Tue Oct 2 22:15:23 2018 -0700

Pluggable Storage.

Basically, the attached patch contains changes that slotify the
trigger tuple handling. Details below :

In the pluggable storage changes, there were some TODOs such as this
in trigger.c :
- /* TODO : */
- if (false && oldtuple != newtuple && oldtuple != slottuple)

I removed this condition. Andres, you had put this in the pluggable
storage patch, probably to check whether it is important. But after
giving a thought, I think it is not required.

Did all the slotification changes in ri_trigger.c also, because they
are all dependent on the slotification of Trigger tuples.

In AfterTriggerSaveEvent(), newslot->tts_tid value is copied over to
new_event.ate_ctid1. Since this function only accepts slot now,
there's no point in retrieving the tid from the slot tuple since later
on we are going to have tid in the slot, looking at the pluggable
storage changes. So in a separate patch
(0001-Populate-slot-tts_tid-wherever-tuple-t_self-changes.patch), I
have just added this field in the TupleTableSlot, and populated
slot->tts_tid wherever tuple->t_self changes.

[1] https://commitfest.postgresql.org/14/1283/

--
Thanks,
-Amit Khandekar
EnterpriseDB Corporation
The Postgres Database Company

Attachment Content-Type Size
0001-Populate-slot-tts_tid-wherever-tuple-t_self-changes.patch application/octet-stream 5.6 KB
0002-Trigger-tuple-slotification.patch application/octet-stream 78.4 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Khandekar 2018-11-19 10:18:31 Re: TupleTableSlot abstraction
Previous Message Masahiko Sawada 2018-11-19 09:28:35 Re: logical decoding vs. VACUUM FULL / CLUSTER on table with TOAST-ed data