Re: [HACKERS] New Event Trigger: table_rewrite

2014-12-01 Thread Michael Paquier
On Thu, Nov 20, 2014 at 10:37 PM, Dimitri Fontaine wrote: > Alvaro Herrera writes: >>> CLUSTER and VACUUM are not part of the supported commands anymore, so >>> I think that we could replace that by the addition of a reference >>> number in the cell of ALTER TABLE for the event table_rewrite and

Re: [HACKERS] New Event Trigger: table_rewrite

2014-11-20 Thread Dimitri Fontaine
Alvaro Herrera writes: >> CLUSTER and VACUUM are not part of the supported commands anymore, so >> I think that we could replace that by the addition of a reference >> number in the cell of ALTER TABLE for the event table_rewrite and >> write at the bottom of the table a description of how this ev

Re: [HACKERS] New Event Trigger: table_rewrite

2014-11-19 Thread Alvaro Herrera
Michael Paquier wrote: > 1) Couldn't this paragraph be reworked? > > +The table_rewrite event occurs just before a table is going > to > +get rewritten by the commands ALTER TABLE. While other > +control statements are available to rewrite a table, > +like CLUSTER and VACUUM,

Re: [HACKERS] New Event Trigger: table_rewrite

2014-11-19 Thread Michael Paquier
On Thu, Nov 20, 2014 at 2:57 AM, Dimitri Fontaine wrote: > Fixed in the attached version of the patch. Thanks! Things are moving nicely for this patch. Patch compiles and passes check-world. Some minor comments about the latest version: 1) Couldn't this paragraph be reworked? +The table_r

Re: [HACKERS] New Event Trigger: table_rewrite

2014-11-19 Thread Robert Haas
On Wed, Nov 19, 2014 at 1:01 PM, Robert Haas wrote: > On Tue, Nov 18, 2014 at 5:14 PM, Dimitri Fontaine > wrote: >> Robert Haas writes: >>> It seems pretty weird, also, that the event trigger will fire after >>> we've taken AccessExclusiveLock when you cluster a particular >>> relation, and befo

Re: [HACKERS] New Event Trigger: table_rewrite

2014-11-19 Thread Robert Haas
On Tue, Nov 18, 2014 at 5:34 PM, Alvaro Herrera wrote: > Almost the whole of that function is conditions to bail out clustering > the relation if things have changed since the relation list was > collected. It seems wrong to invoke the event trigger in all those > cases; it's going to fire spurio

Re: [HACKERS] New Event Trigger: table_rewrite

2014-11-19 Thread Robert Haas
On Tue, Nov 18, 2014 at 5:14 PM, Dimitri Fontaine wrote: > Robert Haas writes: >> It seems pretty weird, also, that the event trigger will fire after >> we've taken AccessExclusiveLock when you cluster a particular >> relation, and before we've taken AccessExclusiveLock when you cluster >> databa

Re: [HACKERS] New Event Trigger: table_rewrite

2014-11-19 Thread Dimitri Fontaine
Alvaro Herrera writes: > Almost the whole of that function is conditions to bail out clustering > the relation if things have changed since the relation list was > collected. It seems wrong to invoke the event trigger in all those > cases; it's going to fire spuriously. I think you should move t

Re: [HACKERS] New Event Trigger: table_rewrite

2014-11-18 Thread Alvaro Herrera
Dimitri Fontaine wrote: > In the CLUSTER implementation we have only one call site for invoking > the Event Trigger, in cluster_rel(). While it's true that in the single > relation case, the relation is opened in cluster() then cluster_rel() is > called, the opening is done with NoLock in cluster(

Re: [HACKERS] New Event Trigger: table_rewrite

2014-11-18 Thread Dimitri Fontaine
Hi, Michael Paquier writes: > 1) This patch is authorizing VACUUM and CLUSTER to use the event > triggers ddl_command_start and ddl_command_end, but aren't those > commands actually not DDLs but control commands? Reverted in the attached version 3 of the patch. > 6) in_table_rewrite seems unnec

Re: [HACKERS] New Event Trigger: table_rewrite

2014-11-17 Thread Robert Haas
On Sun, Nov 16, 2014 at 5:51 AM, Simon Riggs wrote: > On 16 November 2014 06:59, Michael Paquier wrote: >> 1) This patch is authorizing VACUUM and CLUSTER to use the event >> triggers ddl_command_start and ddl_command_end, but aren't those >> commands actually not DDLs but control commands? > > I

Re: [HACKERS] New Event Trigger: table_rewrite

2014-11-16 Thread Simon Riggs
On 16 November 2014 06:59, Michael Paquier wrote: > 1) This patch is authorizing VACUUM and CLUSTER to use the event > triggers ddl_command_start and ddl_command_end, but aren't those > commands actually not DDLs but control commands? I could go either way on that. I'm happy to remove those from

Re: [HACKERS] New Event Trigger: table_rewrite

2014-11-16 Thread Simon Riggs
On 16 November 2014 06:59, Michael Paquier wrote: > Note that this patch has been submitted but there have been no real > discussion around it.. This seems a bit too fast to commit it, no? Committing uncontentious patches at the end of the commitfest seems normal, no? -- Simon Riggs

Re: [HACKERS] New Event Trigger: table_rewrite

2014-11-15 Thread Michael Paquier
On Sun, Nov 16, 2014 at 8:57 AM, Simon Riggs wrote: > On 7 November 2014 12:35, Dimitri Fontaine wrote: >> Simon Riggs writes: >>> It would be more useful to work on the applications of this >>> >>> 1. INSERT into a table >>> * Action start time >>> * Schema >>> * Tablename >>> * Number of b

Re: [HACKERS] New Event Trigger: table_rewrite

2014-11-15 Thread Simon Riggs
On 7 November 2014 12:35, Dimitri Fontaine wrote: > Simon Riggs writes: >> It would be more useful to work on the applications of this >> >> 1. INSERT into a table >> * Action start time >> * Schema >> * Tablename >> * Number of blocks in table >> which would then allow you to do these things

Re: [HACKERS] New Event Trigger: table_rewrite

2014-11-07 Thread Dimitri Fontaine
Simon Riggs writes: > It would be more useful to work on the applications of this > > 1. INSERT into a table > * Action start time > * Schema > * Tablename > * Number of blocks in table > which would then allow you to do these things run an assessment report > showing which tables would be rew

Re: [HACKERS] New Event Trigger: table_rewrite

2014-10-28 Thread Simon Riggs
On 16 October 2014 10:18, Dimitri Fontaine wrote: > Dimitri Fontaine writes: >> Please find attached to this email a patch to implement a new Event >> Trigger, fired on the the "table_rewrite" event. As attached, it's meant >> as a discussion enabler and only supports ALTER TABLE (and maybe not i

Re: [HACKERS] New Event Trigger: table_rewrite

2014-10-16 Thread Dimitri Fontaine
Dimitri Fontaine writes: > Please find attached to this email a patch to implement a new Event > Trigger, fired on the the "table_rewrite" event. As attached, it's meant > as a discussion enabler and only supports ALTER TABLE (and maybe not in > all forms of it). It will need to grow support for V

[HACKERS] New Event Trigger: table_rewrite

2014-10-14 Thread Dimitri Fontaine
Hi fellow hackers, Please find attached to this email a patch to implement a new Event Trigger, fired on the the "table_rewrite" event. As attached, it's meant as a discussion enabler and only supports ALTER TABLE (and maybe not in all forms of it). It will need to grow support for VACUUM FULL and