This was spotted by someone who sent in a doc comment, although didn't
go with their suggestion. Patch attached.

--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

Search Discussions

  • Robert Haas at Mar 7, 2011 at 5:09 pm

    On Mon, Mar 7, 2011 at 7:05 AM, Thom Brown wrote:
    This was spotted by someone who sent in a doc comment, although didn't
    go with their suggestion.  Patch attached.
    That's not really a typo so much as a think-o, I think. Maybe a
    little more text would help clarify: A column-specific trigger (one
    defined using the <literal>UPDATE OF
    <replaceable>column_name</replaceable></literal> syntax) will fire
    when...

    I think it would also be worth modifying this page so that the
    definition of event is in the syntax synopsis.

    Right now:

    rhaas=# \h create trigger
    Command: CREATE TRIGGER
    Description: define a new trigger
    Syntax:
    CREATE [ CONSTRAINT ] TRIGGER name { BEFORE | AFTER | INSTEAD OF } {
    event [ OR ... ] }
    ON table
    [ FROM referenced_table_name ]
    { NOT DEFERRABLE | [ DEFERRABLE ] { INITIALLY IMMEDIATE |
    INITIALLY DEFERRED } }
    [ FOR [ EACH ] { ROW | STATEMENT } ]
    [ WHEN ( condition ) ]
    EXECUTE PROCEDURE function_name ( arguments )

    It should really go on to say... "where event can be one of...", like
    EXPLAIN and COPY do, shouldn't it? Otherwise it's pretty hard to tell
    what you should put there without looking up the main docs.

    --
    Robert Haas
    EnterpriseDB: http://www.enterprisedb.com
    The Enterprise PostgreSQL Company
  • Thom Brown at Mar 7, 2011 at 5:59 pm

    On 7 March 2011 22:39, Robert Haas wrote:
    On Mon, Mar 7, 2011 at 7:05 AM, Thom Brown wrote:
    This was spotted by someone who sent in a doc comment, although didn't
    go with their suggestion.  Patch attached.
    That's not really a typo so much as a think-o, I think.  Maybe a
    little more text would help clarify: A column-specific trigger (one
    defined using the <literal>UPDATE OF
    <replaceable>column_name</replaceable></literal> syntax) will fire
    when...

    I think it would also be worth modifying this page so that the
    definition of event is in the syntax synopsis.

    Right now:

    rhaas=# \h create trigger
    Command:     CREATE TRIGGER
    Description: define a new trigger
    Syntax:
    CREATE [ CONSTRAINT ] TRIGGER name { BEFORE | AFTER | INSTEAD OF } {
    event [ OR ... ] }
    ON table
    [ FROM referenced_table_name ]
    { NOT DEFERRABLE | [ DEFERRABLE ] { INITIALLY IMMEDIATE |
    INITIALLY DEFERRED } }
    [ FOR [ EACH ] { ROW | STATEMENT } ]
    [ WHEN ( condition ) ]
    EXECUTE PROCEDURE function_name ( arguments )

    It should really go on to say... "where event can be one of...", like
    EXPLAIN and COPY do, shouldn't it?  Otherwise it's pretty hard to tell
    what you should put there without looking up the main docs.
    Yes, absolutely. In fact that's what I was looking for when I first
    visited that page.

    So it would look like this:

    where event can be one of:

    INSERT [ OF column ]
    UPDATE [ OF column ]
    DELETE [ OF column ]
    TRUNCATE

    --
    Thom Brown
    Twitter: @darkixion
    IRC (freenode): dark_ixion
    Registered Linux user: #516935
  • Robert Haas at Mar 7, 2011 at 6:13 pm

    On Mon, Mar 7, 2011 at 12:59 PM, Thom Brown wrote:
    On 7 March 2011 22:39, Robert Haas wrote:
    On Mon, Mar 7, 2011 at 7:05 AM, Thom Brown wrote:
    This was spotted by someone who sent in a doc comment, although didn't
    go with their suggestion.  Patch attached.
    That's not really a typo so much as a think-o, I think.  Maybe a
    little more text would help clarify: A column-specific trigger (one
    defined using the <literal>UPDATE OF
    <replaceable>column_name</replaceable></literal> syntax) will fire
    when...

    I think it would also be worth modifying this page so that the
    definition of event is in the syntax synopsis.

    Right now:

    rhaas=# \h create trigger
    Command:     CREATE TRIGGER
    Description: define a new trigger
    Syntax:
    CREATE [ CONSTRAINT ] TRIGGER name { BEFORE | AFTER | INSTEAD OF } {
    event [ OR ... ] }
    ON table
    [ FROM referenced_table_name ]
    { NOT DEFERRABLE | [ DEFERRABLE ] { INITIALLY IMMEDIATE |
    INITIALLY DEFERRED } }
    [ FOR [ EACH ] { ROW | STATEMENT } ]
    [ WHEN ( condition ) ]
    EXECUTE PROCEDURE function_name ( arguments )

    It should really go on to say... "where event can be one of...", like
    EXPLAIN and COPY do, shouldn't it?  Otherwise it's pretty hard to tell
    what you should put there without looking up the main docs.
    Yes, absolutely.  In fact that's what I was looking for when I first
    visited that page.

    So it would look like this:

    where event can be one of:

    INSERT [ OF column ]
    UPDATE [ OF column ]
    DELETE [ OF column ]
    TRUNCATE
    Well, the existing documentation says that OF column is only allowed for UPDATE.

    --
    Robert Haas
    EnterpriseDB: http://www.enterprisedb.com
    The Enterprise PostgreSQL Company
  • Thom Brown at Mar 7, 2011 at 6:27 pm

    On 7 March 2011 23:43, Robert Haas wrote:
    On Mon, Mar 7, 2011 at 12:59 PM, Thom Brown wrote:
    On 7 March 2011 22:39, Robert Haas wrote:
    On Mon, Mar 7, 2011 at 7:05 AM, Thom Brown wrote:
    This was spotted by someone who sent in a doc comment, although didn't
    go with their suggestion.  Patch attached.
    That's not really a typo so much as a think-o, I think.  Maybe a
    little more text would help clarify: A column-specific trigger (one
    defined using the <literal>UPDATE OF
    <replaceable>column_name</replaceable></literal> syntax) will fire
    when...

    I think it would also be worth modifying this page so that the
    definition of event is in the syntax synopsis.

    Right now:

    rhaas=# \h create trigger
    Command:     CREATE TRIGGER
    Description: define a new trigger
    Syntax:
    CREATE [ CONSTRAINT ] TRIGGER name { BEFORE | AFTER | INSTEAD OF } {
    event [ OR ... ] }
    ON table
    [ FROM referenced_table_name ]
    { NOT DEFERRABLE | [ DEFERRABLE ] { INITIALLY IMMEDIATE |
    INITIALLY DEFERRED } }
    [ FOR [ EACH ] { ROW | STATEMENT } ]
    [ WHEN ( condition ) ]
    EXECUTE PROCEDURE function_name ( arguments )

    It should really go on to say... "where event can be one of...", like
    EXPLAIN and COPY do, shouldn't it?  Otherwise it's pretty hard to tell
    what you should put there without looking up the main docs.
    Yes, absolutely.  In fact that's what I was looking for when I first
    visited that page.

    So it would look like this:

    where event can be one of:

    INSERT [ OF column ]
    UPDATE [ OF column ]
    DELETE [ OF column ]
    TRUNCATE
    Well, the existing documentation says that OF column is only allowed for UPDATE.
    *copy/paste fail* Yes, utterly meaningless for INSERT/DELETE.

    --
    Thom Brown
    Twitter: @darkixion
    IRC (freenode): dark_ixion
    Registered Linux user: #516935
  • Tom Lane at Mar 7, 2011 at 9:02 pm

    Thom Brown writes:
    On 7 March 2011 22:39, Robert Haas wrote:
    That's not really a typo so much as a think-o, I think. Maybe a
    little more text would help clarify: A column-specific trigger (one
    defined using the <literal>UPDATE OF
    <replaceable>column_name</replaceable></literal> syntax) will fire
    when...

    It should really go on to say... "where event can be one of...", like
    EXPLAIN and COPY do, shouldn't it? Otherwise it's pretty hard to tell
    what you should put there without looking up the main docs.
    Yes, absolutely. In fact that's what I was looking for when I first
    visited that page.
    Applied both of these changes along with a bit of markup cleanup.

    regards, tom lane

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-hackers @
categoriespostgresql
postedMar 7, '11 at 12:06p
activeMar 7, '11 at 9:02p
posts6
users3
websitepostgresql.org...
irc#postgresql

People

Translate

site design / logo © 2022 Grokbase