Re: New error code to track unsupported contexts - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: New error code to track unsupported contexts
Date
Msg-id 20150408012127.GQ4369@alvh.no-ip.org
Whole thread Raw
In response to Re: New error code to track unsupported contexts  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Responses Re: New error code to track unsupported contexts
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Doubt about AccessExclusiveLock in ALTER TABLE .. SET ( .. );
Next
From: Jim Nasby
Date:
Subject: Re: pg_regress writes into source tree