2011/11/25 Robert Haas <robertmhaas(at)gmail(dot)com>:
> On Thu, Nov 24, 2011 at 12:30 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
>> There are small issue in PL/pgSQL and custom exceptions. Custom
>> exception doesn't set a CONTEXT field. I propose change this behave
>> for WARNING or EXCEPTION level. The goal is same behave for custom
>> exception and builtin exception and it can help to identify a RAISE
>> statement that is responsible to exception.
> That seems completely arbitrary. I think we discussed before
> providing an option to allow the user to control this, which seems
> better than implementing some hardcoded rule that may or may not be
> what a given user wants.
A some option via #option or GUC has sense for lower levels like
NOTICE or WARNING. For exception level CONTEXT should be filled every
time - usually you have a stack of CONTEXT calls, because exception
must not be on direct call, but the last CONTEXT (where exception was
created missing). It is confusing. When a advanced developer see a
exception without CONTEXT, then he know so exception is related to
RAISE statement, but still is not simple find a statement, that raised
exception - the line number is missing.
Compromise solution can be GUC where CONTEXT is default for ERROR level
like plpgsql.log_context_error_level = ERROR
A new option on RAISE STATEMENT is not well, usually you want to same
behave on complete application.
> Robert Haas
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
In response to
pgsql-hackers by date
|Next:||From: Etsuro Fujita||Date: 2011-11-25 08:27:53|
|Subject: Re: pgsql_fdw, FDW for PostgreSQL server|
|Previous:||From: Pavan Deolasee||Date: 2011-11-25 04:54:23|
|Subject: Re: Storing hot members of PGPROC out of the band|