Thread

Commits

  1. Change SQLSTATE for event triggers "wrong context" message

  1. New error code to track unsupported contexts

    Michael Paquier <michael.paquier@gmail.com> — 2014-11-29T05:41:47Z

    Hi all,
    
    When pg_event_trigger_dropped_objects is run in a context that is not
    the one of an event trigger, currently the error code
    ERRCODE_FEATURE_NOT_SUPPORTED is returned. Wouldn't it be better to
    have an error to define an out-of-context instead? It seems that it
    would be a good thing to have more error verbosity for situations like
    the case above. Note that this idea has been mentioned on this ML a
    couple of weeks back. In any case, attached is a patch showing the
    idea.
    
    Opinions? Is that worth having?
    Regards,
    -- 
    Michael
    
  2. Re: New error code to track unsupported contexts

    Jim Nasby <jim.nasby@bluetreble.com> — 2015-04-07T22:42:34Z

    On 11/28/14 11:41 PM, Michael Paquier wrote:
    > Hi all,
    >
    > When pg_event_trigger_dropped_objects is run in a context that is not
    > the one of an event trigger, currently the error code
    > ERRCODE_FEATURE_NOT_SUPPORTED is returned. Wouldn't it be better to
    > have an error to define an out-of-context instead? It seems that it
    > would be a good thing to have more error verbosity for situations like
    > the case above. Note that this idea has been mentioned on this ML a
    > couple of weeks back. In any case, attached is a patch showing the
    > idea.
    >
    > Opinions? Is that worth having?
    
    Anything ever happen with this? (FWIW, I'm in favor of it. Reporting the 
    feature isn't supported is confusing...)
    -- 
    Jim Nasby, Data Architect, Blue Treble Consulting
    Data in Trouble? Get it in Treble! http://BlueTreble.com
    
    
    
  3. Re: New error code to track unsupported contexts

    Alvaro Herrera <alvherre@2ndquadrant.com> — 2015-04-08T01:21:27Z

    Jim Nasby wrote:
    > On 11/28/14 11:41 PM, Michael Paquier wrote:
    > >Hi all,
    > >
    > >When pg_event_trigger_dropped_objects is run in a context that is not
    > >the one of an event trigger, currently the error code
    > >ERRCODE_FEATURE_NOT_SUPPORTED is returned. Wouldn't it be better to
    > >have an error to define an out-of-context instead? It seems that it
    > >would be a good thing to have more error verbosity for situations like
    > >the case above. Note that this idea has been mentioned on this ML a
    > >couple of weeks back. In any case, attached is a patch showing the
    > >idea.
    > >
    > >Opinions? Is that worth having?
    > 
    > Anything ever happen with this? (FWIW, I'm in favor of it. Reporting the
    > feature isn't supported is confusing...)
    
    Not opposed to the idea.
    
    Maybe it should be in class 39 'External Routine Invocation Exception'
    instead, like ERRCODE_E_R_I_E_TRIGGER_PROTOCOL_VIOLATED is used by
    various trigger functions.  We could invent
    ERRCODE_E_R_I_E_EVENT_TRIGGER_PROTOCOL_VIOLATED with value 39P03, for
    example.
    
    -- 
    Álvaro Herrera                http://www.2ndQuadrant.com/
    PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
    
    
    
  4. Re: New error code to track unsupported contexts

    Michael Paquier <michael.paquier@gmail.com> — 2015-04-08T05:30:35Z

    On Wed, Apr 8, 2015 at 10:21 AM, Alvaro Herrera
    <alvherre@2ndquadrant.com> wrote:
    > Jim Nasby wrote:
    >> On 11/28/14 11:41 PM, Michael Paquier wrote:
    >> >Hi all,
    >> >
    >> >When pg_event_trigger_dropped_objects is run in a context that is not
    >> >the one of an event trigger, currently the error code
    >> >ERRCODE_FEATURE_NOT_SUPPORTED is returned. Wouldn't it be better to
    >> >have an error to define an out-of-context instead? It seems that it
    >> >would be a good thing to have more error verbosity for situations like
    >> >the case above. Note that this idea has been mentioned on this ML a
    >> >couple of weeks back. In any case, attached is a patch showing the
    >> >idea.
    >> >
    >> >Opinions? Is that worth having?
    >>
    >> Anything ever happen with this? (FWIW, I'm in favor of it. Reporting the
    >> feature isn't supported is confusing...)
    
    This got lost in translation..
    
    > Not opposed to the idea.
    >
    > Maybe it should be in class 39 'External Routine Invocation Exception'
    > instead, like ERRCODE_E_R_I_E_TRIGGER_PROTOCOL_VIOLATED is used by
    > various trigger functions.  We could invent
    > ERRCODE_E_R_I_E_EVENT_TRIGGER_PROTOCOL_VIOLATED with value 39P03, for
    > example.
    
    This looks fine to me, in the spirit of
    ERRCODE_E_R_I_E_TRIGGER_PROTOCOL_VIOLATED. A refreshed patch gives the
    attached, taking into account the event table_rewrite.
    Regards,
    -- 
    Michael
    
  5. Re: New error code to track unsupported contexts

    Alvaro Herrera <alvherre@2ndquadrant.com> — 2015-04-08T18:45:26Z

    Pushed this.
    
    -- 
    Álvaro Herrera                http://www.2ndQuadrant.com/
    PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
    
    
    
  6. Re: New error code to track unsupported contexts

    Michael Paquier <michael.paquier@gmail.com> — 2015-04-08T23:51:08Z

    2015-04-09 3:45 GMT+09:00 Alvaro Herrera <alvherre@2ndquadrant.com>:
    > Pushed this.
    
    Thanks!
    -- 
    Michael