Re: New Event Trigger: table_rewrite

From: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: New Event Trigger: table_rewrite
Date: 2014-11-20 13:37:43
Message-ID: m2y4r6gfh4.fsf@2ndQuadrant.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)2ndquadrant(dot)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 Content-Type Size
table_rewrite.5.patch text/x-patch 53.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alex Shulgin 2014-11-20 14:26:02 Re: Merging recovery.conf into PostgreSQL.conf -- where did this go?
Previous Message Amit Kapila 2014-11-20 12:30:40 Re: pg_background (and more parallelism infrastructure patches)