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

2022-07-31 Thread houzj.f...@fujitsu.com
On Sunday, July 31, 2022 12:12 PM Michael Paquier wrote: > > On Sat, Jul 30, 2022 at 01:13:52PM +, houzj.f...@fujitsu.com wrote: > > I am not against returning the objaddr for cases related to RLS and > RelOption. > > But just to confirm, do you have a use case to use the returned > > address

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

2022-07-30 Thread Michael Paquier
On Sat, Jul 30, 2022 at 01:13:52PM +, houzj.f...@fujitsu.com wrote: > I am not against returning the objaddr for cases related to RLS and RelOption. > But just to confirm, do you have a use case to use the returned > address(relation itself) > for RLS or RelOptions in event trigger ? I asked t

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

2022-07-30 Thread houzj.f...@fujitsu.com
On Saturday, July 30, 2022 3:15 PM Michael Paquier wrote: > On Tue, Jul 26, 2022 at 01:00:41PM +, houzj.f...@fujitsu.com wrote: > > Thanks for the suggestion. I have removed the default and found some > > missed subcommands in 0003 patch. Attach the new version patch here > > (The 0001 and 000

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

2022-07-30 Thread Michael Paquier
On Tue, Jul 26, 2022 at 01:00:41PM +, houzj.f...@fujitsu.com wrote: > Thanks for the suggestion. I have removed the default and found some missed > subcommands in 0003 patch. Attach the new version patch here > (The 0001 and 0002 is unchanged). I have reviewed what you have here, and I found t

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

2022-07-26 Thread houzj.f...@fujitsu.com
On Monday, July 25, 2022 6:26 PM Michael Paquier wrote: > > On Mon, Jul 25, 2022 at 09:25:07AM +, houzj.f...@fujitsu.com wrote: > > BTW, while reviewing it, I found there are some more subcommands that > > the > > get_altertable_subcmdtypes() doesn't handle(e.g., ADD/DROP/SET > > IDENTITY and

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

2022-07-25 Thread Michael Paquier
On Mon, Jul 25, 2022 at 09:25:07AM +, houzj.f...@fujitsu.com wrote: > BTW, while reviewing it, I found there are some more subcommands that the > get_altertable_subcmdtypes() doesn't handle(e.g., ADD/DROP/SET IDENTITY and > re ADD > STAT). Shall we fix them all while on it ? > > Attach a mino

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

2022-07-25 Thread Alvaro Herrera
On 2022-Jul-25, houzj.f...@fujitsu.com wrote: > BTW, while reviewing it, I found there are some more subcommands that the > get_altertable_subcmdtypes() doesn't handle(e.g., ADD/DROP/SET IDENTITY and > re ADD > STAT). Shall we fix them all while on it ? > > Attach a minor patch to fix those whic

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

2022-07-25 Thread houzj.f...@fujitsu.com
On Saturday, July 23, 2022 6:58 PM Michael Paquier wrote: > > On Sat, Jul 23, 2022 at 05:44:28PM +0900, Michael Paquier wrote: > > Changing get_altertable_subcmdtypes() to return a set of rows made of > > (subcommand, object description) is what I actually meant upthread as > > it feels natural g

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

2022-07-25 Thread Michael Paquier
On Mon, Jul 25, 2022 at 08:42:18AM +0530, Amit Kapila wrote: > What I intended to say is similar to what you have done in the patch > but in a new function. OTOH, your point that it is okay to change > function signature/name in the test module seems reasonable to me. Thanks. Let's do with the fu

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

2022-07-24 Thread Amit Kapila
On Sat, Jul 23, 2022 at 4:28 PM Michael Paquier wrote: > > On Sat, Jul 23, 2022 at 05:44:28PM +0900, Michael Paquier wrote: > > Changing get_altertable_subcmdtypes() to return a set of rows made of > > (subcommand, object description) is what I actually meant upthread as > > it feels natural given

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

2022-07-23 Thread Michael Paquier
On Sat, Jul 23, 2022 at 05:44:28PM +0900, Michael Paquier wrote: > Changing get_altertable_subcmdtypes() to return a set of rows made of > (subcommand, object description) is what I actually meant upthread as > it feels natural given a CollectedCommand in input, and as > pg_event_trigger_ddl_comman

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

2022-07-23 Thread Michael Paquier
On Fri, Jul 22, 2022 at 02:26:02PM +0530, Amit Kapila wrote: > Yeah, that would be a good idea but I think instead of changing > get_altertable_subcmdtypes(), can we have a new function say > get_altertable_subcmdinfo() that returns additional information from > address. The other alternative could

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

2022-07-22 Thread Amit Kapila
On Thu, Jul 21, 2022 at 11:53 AM Michael Paquier wrote: > > On Wed, Jul 20, 2022 at 04:36:13PM +0530, Amit Kapila wrote: > > Right. But, I noticed that get_altertable_subcmdtypes() doesn't handle > > AT_AttachPartition or AT_DetachPartition. We can handle those and at > > least have a test for tho

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

2022-07-20 Thread Michael Paquier
On Wed, Jul 20, 2022 at 04:36:13PM +0530, Amit Kapila wrote: > Right. But, I noticed that get_altertable_subcmdtypes() doesn't handle > AT_AttachPartition or AT_DetachPartition. We can handle those and at > least have a test for those in test_ddl_deparse\sql\slter_table.sql. I > know it is not dire

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

2022-07-20 Thread Amit Kapila
On Fri, Jul 15, 2022 at 11:39 AM houzj.f...@fujitsu.com wrote: > > On Friday, July 15, 2022 11:41 AM Michael Paquier wrote: > > Hi, > > > > On Fri, Jul 15, 2022 at 03:21:30AM +, kuroda.hay...@fujitsu.com wrote: > > > Sounds good. I grepped ATExecXXX() functions called in ATExecCmd(), > > > an

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

2022-07-15 Thread kuroda.hay...@fujitsu.com
Dear Hou-san, > 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 :( > Th

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

2022-07-14 Thread houzj.f...@fujitsu.com
On Friday, July 15, 2022 11:41 AM Michael Paquier wrote: Hi, > > On Fri, Jul 15, 2022 at 03:21:30AM +, kuroda.hay...@fujitsu.com wrote: > > Sounds good. I grepped ATExecXXX() functions called in ATExecCmd(), > > and I confirmed that all returned values have been collected except them. > > >

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

2022-07-14 Thread Michael Paquier
On Fri, Jul 15, 2022 at 03:21:30AM +, kuroda.hay...@fujitsu.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 n

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

2022-07-14 Thread kuroda.hay...@fujitsu.com
Hi, > > I noticed that we didn't collect the ObjectAddress returned by > > ATExec[Attach|Detach]Partition. I think collecting this information can > > make it > > easier for users to get the partition OID of the attached or detached table > > in > > the event trigger. So how about collecting it

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

2022-07-14 Thread houzj.f...@fujitsu.com
On Wednesday, July 13, 2022 5:58 PM Hou, Zhijie wrote: > Hi hackers, > > I noticed that we didn't collect the ObjectAddress returned by > ATExec[Attach|Detach]Partition. I think collecting this information can make > it > easier for users to get the partition OID of the attached or detached table