Re: New Event Trigger: table_rewrite - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: New Event Trigger: table_rewrite
Date
Msg-id m2y4r6gfh4.fsf@2ndQuadrant.fr
Whole thread Raw
In response to Re: New Event Trigger: table_rewrite  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: New Event Trigger: table_rewrite  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@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 description of how this event
>> behaves with ALTER TABLE. Note as well that "might or might not" is
>> not really helpful for the user.
>
> That's precisely why we have an event trigger here, I think --- for some
> subcommands, it's not easy to determine whether a rewrite happens or
> not.  (I think SET TYPE is the one).  I don't think we want to document
> precisely under what condition a rewrite takes place.

Yeah, the current documentation expands to the following sentence, as
browsed in

  http://www.postgresql.org/docs/9.3/interactive/sql-altertable.html

  As an exception, if the USING clause does not change the column
  contents and the old type is either binary coercible to the new type
  or an unconstrained domain over the new type, a table rewrite is not
  needed, but any indexes on the affected columns must still be rebuilt.

I don't think that “might or might not” is less helpful in the context
of the Event Trigger, because the whole point is that the event is only
triggered in case of a rewrite. Of course we could cross link the two
paragraphs or something.

>> 2) The examples of SQL queries provided are still in lower case in the
>> docs, that's contrary to the rest of the docs where upper case is used
>> for reserved keywords.

Right, being consistent trumps personal preferences, changed in the
attached.

> Yes please.  <nitpick> Another thing in that sample code is "not current_hour
> between 1 and 6".  That reads strange to me.  It should be equally
> correct to spell it as "current_hour not between 1 and 6", which seems
> more natural. </>

True, fixed in the attached.

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support


Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: pg_background (and more parallelism infrastructure patches)
Next
From: Alex Shulgin
Date:
Subject: Re: Merging recovery.conf into PostgreSQL.conf -- where did this go?