RE: Collect ObjectAddress for ATTACH DETACH PARTITION to use in event trigger

From: "houzj(dot)fnst(at)fujitsu(dot)com" <houzj(dot)fnst(at)fujitsu(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>, "kuroda(dot)hayato(at)fujitsu(dot)com" <kuroda(dot)hayato(at)fujitsu(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: RE: Collect ObjectAddress for ATTACH DETACH PARTITION to use in event trigger
Date: 2022-07-15 06:08:54
Message-ID: OS0PR01MB5716D110FDDBD93DFFBFFD58948B9@OS0PR01MB5716.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Friday, July 15, 2022 11:41 AM Michael Paquier <michael(at)paquier(dot)xyz> wrote:

Hi,
>
> On Fri, Jul 15, 2022 at 03:21:30AM +0000, kuroda(dot)hayato(at)fujitsu(dot)com wrote:
> > Sounds good. I grepped ATExecXXX() functions called in ATExecCmd(),
> > and I confirmed that all returned values have been collected except them.
> >
> > While checking test code test about EVENT TRIGGER, I found there were
> > no tests related with partitions in that.
> > How about adding them?
>
> Agreed. It would be good to track down what changes once those
> ObjectAddresses are collected.

Thanks for having a look. It was a bit difficult to add a test for this.
Because we currently don't have a user function which can return these
collected ObjectAddresses for ALTER TABLE. And It seems we don't have tests for
already collected ObjectAddresses as well :(

The collected ObjectAddresses is in
"currentEventTriggerState->currentCommand->d.alterTable.subcmds.address" while
the public function pg_event_trigger_ddl_commands doesn't return these
information. It can only be used in user defined event trigger function (C
code).

If we want to add some tests for both already existed and newly added
ObjectAddresses, we might need to add some test codes in test_ddl_deparse.c.
What do you think ?

Best regards,
Hou zhijie

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Erik Rijkers 2022-07-15 06:20:59 Re: SQL/JSON documentation JSON_TABLE
Previous Message David Rowley 2022-07-15 05:18:09 Re: POC: GROUP BY optimization