Re: [HACKERS] New Event Trigger: table_rewrite

2014-12-01 Thread Michael Paquier
On Thu, Nov 20, 2014 at 10:37 PM, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Alvaro Herrera alvhe...@2ndquadrant.com 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

Re: [HACKERS] New Event Trigger: table_rewrite

2014-11-20 Thread Dimitri Fontaine
Alvaro Herrera alvhe...@2ndquadrant.com 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

Re: [HACKERS] New Event Trigger: table_rewrite

2014-11-19 Thread Dimitri Fontaine
Alvaro Herrera alvhe...@2ndquadrant.com 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

Re: [HACKERS] New Event Trigger: table_rewrite

2014-11-19 Thread Robert Haas
On Tue, Nov 18, 2014 at 5:14 PM, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Robert Haas robertmh...@gmail.com 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

Re: [HACKERS] New Event Trigger: table_rewrite

2014-11-19 Thread Robert Haas
On Tue, Nov 18, 2014 at 5:34 PM, Alvaro Herrera alvhe...@2ndquadrant.com 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

Re: [HACKERS] New Event Trigger: table_rewrite

2014-11-19 Thread Robert Haas
On Wed, Nov 19, 2014 at 1:01 PM, Robert Haas robertmh...@gmail.com wrote: On Tue, Nov 18, 2014 at 5:14 PM, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Robert Haas robertmh...@gmail.com writes: It seems pretty weird, also, that the event trigger will fire after we've taken

Re: [HACKERS] New Event Trigger: table_rewrite

2014-11-19 Thread Michael Paquier
On Thu, Nov 20, 2014 at 2:57 AM, Dimitri Fontaine dimi...@2ndquadrant.fr 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?

Re: [HACKERS] New Event Trigger: table_rewrite

2014-11-19 Thread Alvaro Herrera
Michael Paquier wrote: 1) Couldn't this paragraph be reworked? para +The literaltable_rewrite/ event occurs just before a table is going to +get rewritten by the commands literalALTER TABLE/literal. While other +control statements are available to rewrite a table, +

Re: [HACKERS] New Event Trigger: table_rewrite

2014-11-18 Thread Dimitri Fontaine
Hi, Michael Paquier michael.paqu...@gmail.com 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)

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-17 Thread Robert Haas
On Sun, Nov 16, 2014 at 5:51 AM, Simon Riggs si...@2ndquadrant.com wrote: On 16 November 2014 06:59, Michael Paquier michael.paqu...@gmail.com 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

Re: [HACKERS] New Event Trigger: table_rewrite

2014-11-16 Thread Simon Riggs
On 16 November 2014 06:59, Michael Paquier michael.paqu...@gmail.com 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? --

Re: [HACKERS] New Event Trigger: table_rewrite

2014-11-16 Thread Simon Riggs
On 16 November 2014 06:59, Michael Paquier michael.paqu...@gmail.com 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

Re: [HACKERS] New Event Trigger: table_rewrite

2014-11-15 Thread Simon Riggs
On 7 November 2014 12:35, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Simon Riggs si...@2ndquadrant.com 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

Re: [HACKERS] New Event Trigger: table_rewrite

2014-11-15 Thread Michael Paquier
On Sun, Nov 16, 2014 at 8:57 AM, Simon Riggs si...@2ndquadrant.com wrote: On 7 November 2014 12:35, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Simon Riggs si...@2ndquadrant.com writes: It would be more useful to work on the applications of this 1. INSERT into a table * Action start

Re: [HACKERS] New Event Trigger: table_rewrite

2014-11-07 Thread Dimitri Fontaine
Simon Riggs si...@2ndquadrant.com 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

Re: [HACKERS] New Event Trigger: table_rewrite

2014-10-28 Thread Simon Riggs
On 16 October 2014 10:18, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Dimitri Fontaine dimi...@2ndquadrant.fr 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

Re: [HACKERS] New Event Trigger: table_rewrite

2014-10-16 Thread Dimitri Fontaine
Dimitri Fontaine dimi...@2ndquadrant.fr 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