Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-09-06 Thread Tom Lane
Joe Conway writes: >> On 09/05/2015 09:05 AM, Tom Lane wrote: >>> Pushed. I'm not too sure about the expected outputs for python other >>> than 2.6, nor for sepgsql, but hopefully the buildfarm will provide >>> feedback. > One-liner required for sepgsql -- attached committed and pushed. Thanks

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-09-06 Thread Joe Conway
On 09/05/2015 09:14 AM, Joe Conway wrote: > On 09/05/2015 09:05 AM, Tom Lane wrote: >> I wrote: >>> If there are not major objections, I'll work on cleaning up and >>> committing the patch. >> >> Pushed. I'm not too sure about the expected outputs for python other >> than 2.6, nor for sepgsql, but

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-09-05 Thread Pavel Stehule
> Pushed. I'm not too sure about the expected outputs for python other > than 2.6, nor for sepgsql, but hopefully the buildfarm will provide > feedback. > > Thank you very much Pavel

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-09-05 Thread Joe Conway
On 09/05/2015 09:05 AM, Tom Lane wrote: > I wrote: >> If there are not major objections, I'll work on cleaning up and >> committing the patch. > > Pushed. I'm not too sure about the expected outputs for python other > than 2.6, nor for sepgsql, but hopefully the buildfarm will provide > feedback.

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-09-05 Thread Tom Lane
I wrote: > If there are not major objections, I'll work on cleaning up and > committing the patch. Pushed. I'm not too sure about the expected outputs for python other than 2.6, nor for sepgsql, but hopefully the buildfarm will provide feedback. BTW, I noticed that the PageOutput line counts for

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-09-04 Thread Tom Lane
Pavel Stehule writes: > 2015-08-12 11:07 GMT+02:00 Marko Tiikkaja : >> I'm somewhat worried that this is hiding important context from some >> NOTICE or WARNING messages intended for novice users, but probably not >> worried enough to go through all of them. +3/8 from me, I guess. > I fixed ment

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-08-12 Thread Pavel Stehule
Hi 2015-08-12 11:07 GMT+02:00 Marko Tiikkaja : > On 8/12/15 9:36 AM, Pavel Stehule wrote: > >> So, there is common agreement on this version. >> > > There are several instances of double semicolons. Also, > PsqlSettings.show_context doesn't look like a boolean to me. For > SHOW_CONTEXT, it woul

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-08-12 Thread Pavel Stehule
2015-08-12 11:07 GMT+02:00 Marko Tiikkaja : > On 8/12/15 9:36 AM, Pavel Stehule wrote: > >> So, there is common agreement on this version. >> > > There are several instances of double semicolons. Also, > PsqlSettings.show_context doesn't look like a boolean to me. For > SHOW_CONTEXT, it would be

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-08-12 Thread Marko Tiikkaja
On 8/12/15 9:36 AM, Pavel Stehule wrote: So, there is common agreement on this version. There are several instances of double semicolons. Also, PsqlSettings.show_context doesn't look like a boolean to me. For SHOW_CONTEXT, it would be good if the documentation mentioned the default value.

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-08-12 Thread Pavel Stehule
2015-08-10 18:43 GMT+02:00 Pavel Stehule : > > > 2015-08-10 9:11 GMT+02:00 Heikki Linnakangas : > >> On 07/26/2015 08:34 AM, Pavel Stehule wrote: >> >>> Hi >>> >>> here is complete patch, that introduce context filtering on client side. >>> The core of this patch is trivial and small - almost all

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-08-10 Thread Pavel Stehule
2015-08-10 9:11 GMT+02:00 Heikki Linnakangas : > On 07/26/2015 08:34 AM, Pavel Stehule wrote: > >> Hi >> >> here is complete patch, that introduce context filtering on client side. >> The core of this patch is trivial and small - almost all of size are >> trivial changes in regress tests - removin

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-08-10 Thread Heikki Linnakangas
On 07/26/2015 08:34 AM, Pavel Stehule wrote: Hi here is complete patch, that introduce context filtering on client side. The core of this patch is trivial and small - almost all of size are trivial changes in regress tests - removing useless context. Documentation, check-world Looks good to m

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-25 Thread Pavel Stehule
Hi here is complete patch, that introduce context filtering on client side. The core of this patch is trivial and small - almost all of size are trivial changes in regress tests - removing useless context. Documentation, check-world Regards Pavel 2015-07-26 0:42 GMT+02:00 Pavel Stehule : > Hi

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-25 Thread Pavel Stehule
Hi I am sending a next variant of filtering context patch. postgres=# do $$ begin raise notice 'kuku'; end $$; NOTICE: kuku DO Time: 2.441 ms postgres=# do $$ begin raise exception 'kuku'; end $$; ERROR: kuku CONTEXT: PL/pgSQL function inline_code_block line 1 at RAISE Time: 0.648 ms postgres=

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-25 Thread Pavel Stehule
2015-07-21 16:58 GMT+02:00 Merlin Moncure : > On Tue, Jul 21, 2015 at 2:53 AM, Heikki Linnakangas > wrote: > > On 07/21/2015 10:38 AM, Pavel Stehule wrote: > >> > >> where we are with this patch? Can I do some for it? > > > > > > I still feel this approach is misguided, and we should be tweaking

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-21 Thread Merlin Moncure
On Tue, Jul 21, 2015 at 2:53 AM, Heikki Linnakangas wrote: > On 07/21/2015 10:38 AM, Pavel Stehule wrote: >> >> where we are with this patch? Can I do some for it? > > > I still feel this approach is misguided, and we should be tweaking psql > and/or libpq instead. I don't feel strongly though, an

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-21 Thread Pavel Stehule
2015-07-21 9:53 GMT+02:00 Heikki Linnakangas : > On 07/21/2015 10:38 AM, Pavel Stehule wrote: > >> where we are with this patch? Can I do some for it? >> > > I still feel this approach is misguided, and we should be tweaking psql > and/or libpq instead. I don't feel strongly though, and if some ot

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-21 Thread Heikki Linnakangas
On 07/21/2015 10:38 AM, Pavel Stehule wrote: where we are with this patch? Can I do some for it? I still feel this approach is misguided, and we should be tweaking psql and/or libpq instead. I don't feel strongly though, and if some other committer wants to pick this up in its current form, I

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-21 Thread Pavel Stehule
2015-07-09 23:16 GMT+02:00 Pavel Stehule : > > > 2015-07-09 22:57 GMT+02:00 Merlin Moncure : > >> On Thu, Jul 9, 2015 at 3:31 PM, Pavel Stehule >> wrote: >> > >> > >> > 2015-07-09 20:08 GMT+02:00 Merlin Moncure : >> >> >> >> On Thu, Jul 9, 2015 at 10:48 AM, Pavel Stehule < >> pavel.steh...@gmail.

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-09 Thread Pavel Stehule
2015-07-09 22:57 GMT+02:00 Merlin Moncure : > On Thu, Jul 9, 2015 at 3:31 PM, Pavel Stehule > wrote: > > > > > > 2015-07-09 20:08 GMT+02:00 Merlin Moncure : > >> > >> On Thu, Jul 9, 2015 at 10:48 AM, Pavel Stehule > > >> wrote: > >> > > >> > 2015-07-09 15:17 GMT+02:00 Merlin Moncure : > >> >> >

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-09 Thread Merlin Moncure
On Thu, Jul 9, 2015 at 3:31 PM, Pavel Stehule wrote: > > > 2015-07-09 20:08 GMT+02:00 Merlin Moncure : >> >> On Thu, Jul 9, 2015 at 10:48 AM, Pavel Stehule >> wrote: >> > >> > 2015-07-09 15:17 GMT+02:00 Merlin Moncure : >> >> >> >> On Wed, Jul 8, 2015 at 11:28 PM, Pavel Stehule >> >> >> >> wrote

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-09 Thread Pavel Stehule
2015-07-09 20:08 GMT+02:00 Merlin Moncure : > On Thu, Jul 9, 2015 at 10:48 AM, Pavel Stehule > wrote: > > > > 2015-07-09 15:17 GMT+02:00 Merlin Moncure : > >> > >> On Wed, Jul 8, 2015 at 11:28 PM, Pavel Stehule > > >> wrote: > >> > Hi > >> > > >> > second version of this patch > >> > > >> > make

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-09 Thread Merlin Moncure
On Thu, Jul 9, 2015 at 10:48 AM, Pavel Stehule wrote: > > 2015-07-09 15:17 GMT+02:00 Merlin Moncure : >> >> On Wed, Jul 8, 2015 at 11:28 PM, Pavel Stehule >> wrote: >> > Hi >> > >> > second version of this patch >> > >> > make check-world passed >> >> quickly scanning the patch, the implementatio

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-09 Thread Pavel Stehule
2015-07-09 15:17 GMT+02:00 Merlin Moncure : > On Wed, Jul 8, 2015 at 11:28 PM, Pavel Stehule > wrote: > > Hi > > > > second version of this patch > > > > make check-world passed > > quickly scanning the patch, the implementation is trivial (minus > regression test adjustments), and is, IMSNSHO, t

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-09 Thread Merlin Moncure
On Wed, Jul 8, 2015 at 11:28 PM, Pavel Stehule wrote: > Hi > > second version of this patch > > make check-world passed quickly scanning the patch, the implementation is trivial (minus regression test adjustments), and is, IMSNSHO, the right solution. Several of the source level comments need so

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-08 Thread Pavel Stehule
2015-07-08 23:46 GMT+02:00 Merlin Moncure : > On Wed, Jul 8, 2015 at 4:39 PM, Pavel Stehule > wrote: > > 2015-07-08 8:35 GMT+02:00 Pavel Stehule : > >> > >> > >> > >> 2015-07-07 18:15 GMT+02:00 Merlin Moncure : > >>> > >>> On Tue, Jul 7, 2015 at 9:04 AM, Pavel Stehule > > >>> wrote: > >>> >> It

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-08 Thread Merlin Moncure
On Wed, Jul 8, 2015 at 4:39 PM, Pavel Stehule wrote: > 2015-07-08 8:35 GMT+02:00 Pavel Stehule : >> >> >> >> 2015-07-07 18:15 GMT+02:00 Merlin Moncure : >>> >>> On Tue, Jul 7, 2015 at 9:04 AM, Pavel Stehule >>> wrote: >>> >> It doesn't have to if the behavior is guarded with a GUC. I just >>> >>

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-08 Thread Pavel Stehule
2015-07-08 8:35 GMT+02:00 Pavel Stehule : > > > 2015-07-07 18:15 GMT+02:00 Merlin Moncure : > >> On Tue, Jul 7, 2015 at 9:04 AM, Pavel Stehule >> wrote: >> >> It doesn't have to if the behavior is guarded with a GUC. I just >> >> don't understand what all the fuss is about. The default behavior

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-08 Thread Pavel Stehule
Hi here is initial version of reduced patch. It is small code, but relative big (although I expected bigger) change in tests. if these changes are too big, then we have to introduce a plpgsql GUC plpgsql.client_min_context and plpgsql.log_min_client. These GUC overwrite global setting for plpgsql

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-08 Thread Merlin Moncure
On Wed, Jul 8, 2015 at 1:35 AM, Pavel Stehule wrote: > > > 2015-07-07 18:15 GMT+02:00 Merlin Moncure : >> >> On Tue, Jul 7, 2015 at 9:04 AM, Pavel Stehule >> wrote: >> >> It doesn't have to if the behavior is guarded with a GUC. I just >> >> don't understand what all the fuss is about. The defa

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-07 Thread Pavel Stehule
2015-07-07 18:15 GMT+02:00 Merlin Moncure : > On Tue, Jul 7, 2015 at 9:04 AM, Pavel Stehule > wrote: > >> It doesn't have to if the behavior is guarded with a GUC. I just > >> don't understand what all the fuss is about. The default behavior of > >> logging that is well established by other lan

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-07 Thread Pavel Stehule
2015-07-07 18:15 GMT+02:00 Merlin Moncure : > On Tue, Jul 7, 2015 at 9:04 AM, Pavel Stehule > wrote: > >> It doesn't have to if the behavior is guarded with a GUC. I just > >> don't understand what all the fuss is about. The default behavior of > >> logging that is well established by other lan

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-07 Thread Merlin Moncure
On Tue, Jul 7, 2015 at 9:04 AM, Pavel Stehule wrote: >> It doesn't have to if the behavior is guarded with a GUC. I just >> don't understand what all the fuss is about. The default behavior of >> logging that is well established by other languages (for example java) >> that manage error stack fo

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-07 Thread Heikki Linnakangas
On 07/07/2015 04:56 PM, Merlin Moncure wrote: On Tue, Jul 7, 2015 at 8:13 AM, Heikki Linnakangas wrote: On 01/26/2015 05:14 PM, Tom Lane wrote: Pavel Stehule writes: 2015-01-26 14:02 GMT+01:00 Marko Tiikkaja : I am thinking, so solution /* if we are doing RAISE, don't report its

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-07 Thread Pavel Stehule
2015-07-07 15:56 GMT+02:00 Merlin Moncure : > On Tue, Jul 7, 2015 at 8:13 AM, Heikki Linnakangas > wrote: > > On 01/26/2015 05:14 PM, Tom Lane wrote: > >> > >> Pavel Stehule writes: > >>> > >>> 2015-01-26 14:02 GMT+01:00 Marko Tiikkaja : > >>> I am thinking, so solution > >> > >> > >>> /*

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-07 Thread Merlin Moncure
On Tue, Jul 7, 2015 at 8:13 AM, Heikki Linnakangas wrote: > On 01/26/2015 05:14 PM, Tom Lane wrote: >> >> Pavel Stehule writes: >>> >>> 2015-01-26 14:02 GMT+01:00 Marko Tiikkaja : >>> I am thinking, so solution >> >> >>> /* if we are doing RAISE, don't report its location */ >>> if (es

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-07-07 Thread Heikki Linnakangas
On 01/26/2015 05:14 PM, Tom Lane wrote: Pavel Stehule writes: 2015-01-26 14:02 GMT+01:00 Marko Tiikkaja : I am thinking, so solution /* if we are doing RAISE, don't report its location */ if (estate->err_text == raise_skip_msg) return; is too simple, and this part shou

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-30 Thread Pavel Stehule
2015-04-30 10:50 GMT+02:00 Pavel Stehule : > > > 2015-04-30 10:24 GMT+02:00 Marko Tiikkaja : > >> Hi Pavel, >> >> This doesn't seem to be what I thought we had agreed on. For example: >> >> =# create function barf() returns void as $$ begin raise notice without >> context 'hello world'; end $$ la

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-30 Thread Pavel Stehule
2015-04-30 10:24 GMT+02:00 Marko Tiikkaja : > Hi Pavel, > > This doesn't seem to be what I thought we had agreed on. For example: > > =# create function barf() returns void as $$ begin raise notice without > context 'hello world'; end $$ language plpgsql; > CREATE FUNCTION > =# create function fo

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-30 Thread Marko Tiikkaja
Hi Pavel, This doesn't seem to be what I thought we had agreed on. For example: =# create function barf() returns void as $$ begin raise notice without context 'hello world'; end $$ language plpgsql; CREATE FUNCTION =# create function foof() returns void as $$ begin perform barf(); end $$ la

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-30 Thread Pavel Stehule
2015-04-28 19:44 GMT+02:00 Jim Nasby : > On 4/28/15 1:16 AM, Pavel Stehule wrote: > >> >> I think it can't be any clearer than the proposed >> "plpgsql.display_context_min_messages" >> >> >> client_min_context. It's doing the same thing as min_messages does, >> just for con

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-28 Thread Jim Nasby
On 4/28/15 1:16 AM, Pavel Stehule wrote: I think it can't be any clearer than the proposed "plpgsql.display_context_min_messages" client_min_context. It's doing the same thing as min_messages does, just for context instead of the message. Or does this affect client

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-27 Thread Pavel Stehule
2015-04-27 22:53 GMT+02:00 Jim Nasby : > On 4/27/15 11:47 AM, Joel Jacobson wrote: > >> On Mon, Apr 27, 2015 at 6:14 PM, Marko Tiikkaja > > wrote: >> >> That sounds weird. log_min_messages are the messages sent to the >> log; client_min_messages are sent to the client

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-27 Thread Jim Nasby
On 4/27/15 11:47 AM, Joel Jacobson wrote: On Mon, Apr 27, 2015 at 6:14 PM, Marko Tiikkaja mailto:ma...@joh.to>> wrote: That sounds weird. log_min_messages are the messages sent to the log; client_min_messages are sent to the client. context_min_messages are not sent to a "context",

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-27 Thread Joel Jacobson
On Mon, Apr 27, 2015 at 6:14 PM, Marko Tiikkaja wrote: > That sounds weird. log_min_messages are the messages sent to the log; > client_min_messages are sent to the client. context_min_messages are not > sent to a "context", whatever that would mean. Good point. I think it can't be any clear

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-27 Thread Marko Tiikkaja
On 4/27/15 6:08 PM, Fabrízio de Royes Mello wrote: On Sun, Apr 26, 2015 at 4:19 AM, Pavel Stehule wrote: I reduced this patch, little bit cleaned - now it is based on plpgsql GUC display_context_min_messages - like client_min_messages, log_min_messages. What you think just "context_min_messag

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-27 Thread Fabrízio de Royes Mello
On Sun, Apr 26, 2015 at 4:19 AM, Pavel Stehule wrote: > > Hi > > I reduced this patch, little bit cleaned - now it is based on plpgsql GUC display_context_min_messages - like client_min_messages, log_min_messages. > What you think just "context_min_messages" ? Regards, -- Fabrízio de Royes Mell

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-27 Thread Pavel Stehule
2015-04-27 16:05 GMT+02:00 Joel Jacobson : > Looks good Pavel! > > May I just suggest you add the default case > to src/test/regress/sql/plpgsql.sql > and src/test/regress/expected/plpgsql.out, to make it easier for the > reviewer to compare the difference between what happens in the default > cas

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-27 Thread Joel Jacobson
Looks good Pavel! May I just suggest you add the default case to src/test/regress/sql/plpgsql.sql and src/test/regress/expected/plpgsql.out, to make it easier for the reviewer to compare the difference between what happens in the default case, when not using the raise-syntax and not using the GUCs

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-26 Thread Pavel Stehule
Hi I reduced this patch, little bit cleaned - now it is based on plpgsql GUC display_context_min_messages - like client_min_messages, log_min_messages. Documentation added. Regards Pavel 2015-04-25 22:23 GMT+02:00 Pavel Stehule : > Hi > > 2015-04-24 19:16 GMT+02:00 Joel Jacobson : > >> On Fri

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-25 Thread Joel Jacobson
+1 On Sat, Apr 25, 2015 at 10:23 PM, Pavel Stehule wrote: > Hi > > 2015-04-24 19:16 GMT+02:00 Joel Jacobson : > >> On Fri, Apr 24, 2015 at 6:07 PM, Pavel Stehule >> wrote: >> >> Example: >> >> >> >> context_messages = -warning, -error, +notice >> > >> > >> > I prefer your first proposal - and

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-25 Thread Pavel Stehule
Hi 2015-04-24 19:16 GMT+02:00 Joel Jacobson : > On Fri, Apr 24, 2015 at 6:07 PM, Pavel Stehule > wrote: > >> Example: > >> > >> context_messages = -warning, -error, +notice > > > > > > I prefer your first proposal - and there is a precedent for plpgsql - > > plpgsql_extra_checks > > > > It is cl

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-24 Thread Pavel Stehule
2015-04-24 19:16 GMT+02:00 Joel Jacobson : > On Fri, Apr 24, 2015 at 6:07 PM, Pavel Stehule > wrote: > >> Example: > >> > >> context_messages = -warning, -error, +notice > > > > > > I prefer your first proposal - and there is a precedent for plpgsql - > > plpgsql_extra_checks > > > > It is clean

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-24 Thread Joel Jacobson
On Fri, Apr 24, 2015 at 6:07 PM, Pavel Stehule wrote: >> Example: >> >> context_messages = -warning, -error, +notice > > > I prefer your first proposal - and there is a precedent for plpgsql - > plpgsql_extra_checks > > It is clean for anybody. +-identifiers looks like horrible httpd config. :) I

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-24 Thread Pavel Stehule
2015-04-24 16:02 GMT+02:00 Joel Jacobson : > On Fri, Apr 24, 2015 at 1:16 PM, Robert Haas > wrote: > >> This would allow doing something crazy as: > >> > >> suppress_context_messages = warning,error > >> display_context_messages = notice > > > > This is a very flexible proposal, but it's a tremen

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-24 Thread Joel Jacobson
On Fri, Apr 24, 2015 at 1:16 PM, Robert Haas wrote: >> This would allow doing something crazy as: >> >> suppress_context_messages = warning,error >> display_context_messages = notice > > This is a very flexible proposal, but it's a tremendous amount of > machinery for what's really a very minor is

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-24 Thread Pavel Stehule
2015-04-24 13:16 GMT+02:00 Robert Haas : > On Fri, Apr 24, 2015 at 6:11 AM, Joel Jacobson wrote: > > Entering the discussion because this is a huge pain for me in my daily > > work as well. > > > > This is not a reply to any specific post in this thread, but my first > > message in the thread. >

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-24 Thread Robert Haas
On Fri, Apr 24, 2015 at 6:11 AM, Joel Jacobson wrote: > Entering the discussion because this is a huge pain for me in my daily > work as well. > > This is not a reply to any specific post in this thread, but my first > message in the thread. > > I see a great value in providing both a GUC and a ne

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-24 Thread Pavel Stehule
2015-04-24 12:11 GMT+02:00 Joel Jacobson : > Entering the discussion because this is a huge pain for me in my daily > work as well. > > This is not a reply to any specific post in this thread, but my first > message in the thread. > > I see a great value in providing both a GUC and a new RAISE syn

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-24 Thread Joel Jacobson
Entering the discussion because this is a huge pain for me in my daily work as well. This is not a reply to any specific post in this thread, but my first message in the thread. I see a great value in providing both a GUC and a new RAISE syntax. The different benefits of the two are maybe obvious

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-23 Thread Pavel Stehule
2015-04-23 16:12 GMT+02:00 Robert Haas : > On Thu, Apr 23, 2015 at 9:55 AM, Pavel Stehule > wrote: > >> On Thu, Apr 23, 2015 at 4:56 AM, Pavel Stehule > > >> wrote: > >> > I don't see a contradiction. There is clean agreement, so ERROR level > >> > should > >> > to show the context. NOTICE and W

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-23 Thread Robert Haas
On Thu, Apr 23, 2015 at 9:55 AM, Pavel Stehule wrote: >> On Thu, Apr 23, 2015 at 4:56 AM, Pavel Stehule >> wrote: >> > I don't see a contradiction. There is clean agreement, so ERROR level >> > should >> > to show the context. NOTICE and WARNINGs doesn't need it - and there is >> > a >> > backwar

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-23 Thread Pavel Stehule
2015-04-23 15:47 GMT+02:00 Robert Haas : > On Thu, Apr 23, 2015 at 4:56 AM, Pavel Stehule > wrote: > > I don't see a contradiction. There is clean agreement, so ERROR level > should > > to show the context. NOTICE and WARNINGs doesn't need it - and there is a > > backward compatibility and usabil

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-23 Thread Robert Haas
On Thu, Apr 23, 2015 at 4:56 AM, Pavel Stehule wrote: > I don't see a contradiction. There is clean agreement, so ERROR level should > to show the context. NOTICE and WARNINGs doesn't need it - and there is a > backward compatibility and usability reasons don't do it. Whether notices and warnings

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-23 Thread Pavel Stehule
2015-04-23 9:53 GMT+02:00 Marko Tiikkaja : > On 4/2/15 9:37 AM, Pavel Stehule wrote: > >> estate->err_text = stmt->elog_level == ERROR ? estate->err_text : >>> raise_skip_msg ; >>> >> >> Can we do this simple change? It will produce a stackinfo for exceptions >> and it will not to make mad develo

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-23 Thread Marko Tiikkaja
On 4/2/15 9:37 AM, Pavel Stehule wrote: estate->err_text = stmt->elog_level == ERROR ? estate->err_text : raise_skip_msg ; Can we do this simple change? It will produce a stackinfo for exceptions and it will not to make mad developers by lot of useless content. I'm not sure everyone agrees w

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-04-02 Thread Pavel Stehule
2015-01-26 16:46 GMT+01:00 Pavel Stehule : > > > 2015-01-26 16:14 GMT+01:00 Tom Lane : > >> Pavel Stehule writes: >> > 2015-01-26 14:02 GMT+01:00 Marko Tiikkaja : >> > I am thinking, so solution >> >> > /* if we are doing RAISE, don't report its location */ >> > if (estate->err_text == r

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-01-26 Thread Jim Nasby
On 1/26/15 9:46 AM, Pavel Stehule wrote: The design I thought had been agreed on was to add some new option to plpgsql's RAISE command which would cause suppression of all CONTEXT lines not just the most closely nested one. You could argue about whether the behavior needs to be

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-01-26 Thread Pavel Stehule
2015-01-26 16:14 GMT+01:00 Tom Lane : > Pavel Stehule writes: > > 2015-01-26 14:02 GMT+01:00 Marko Tiikkaja : > > I am thinking, so solution > > > /* if we are doing RAISE, don't report its location */ > > if (estate->err_text == raise_skip_msg) > > return; > > > is too simple, a

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-01-26 Thread Tom Lane
Pavel Stehule writes: > 2015-01-26 14:02 GMT+01:00 Marko Tiikkaja : > I am thinking, so solution > /* if we are doing RAISE, don't report its location */ > if (estate->err_text == raise_skip_msg) > return; > is too simple, and this part should be fixed. This change can be done b

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-01-26 Thread Pavel Stehule
2015-01-26 14:02 GMT+01:00 Marko Tiikkaja : > On 1/26/15 1:44 PM, Pavel Stehule wrote: > >> 2015-01-26 13:39 GMT+01:00 Marko Tiikkaja : >> >>> On 1/26/15 1:14 PM, Pavel Stehule wrote: >>> I afraid about some unexpected side effects of your proposal if somebody mix languages - these side

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-01-26 Thread Marko Tiikkaja
On 1/26/15 1:44 PM, Pavel Stehule wrote: 2015-01-26 13:39 GMT+01:00 Marko Tiikkaja : On 1/26/15 1:14 PM, Pavel Stehule wrote: I afraid about some unexpected side effects of your proposal if somebody mix languages - these side effects should not be critical I have no idea what you're talking

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-01-26 Thread Pavel Stehule
2015-01-26 13:39 GMT+01:00 Marko Tiikkaja : > On 1/26/15 1:14 PM, Pavel Stehule wrote: > >> 2015-01-26 13:02 GMT+01:00 Marko Tiikkaja : >> >>> I can see where it's a lot nicer not to have the context visible for >>> people who only care about the contents of the message, but the way it's >>> done

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-01-26 Thread Marko Tiikkaja
On 1/26/15 1:14 PM, Pavel Stehule wrote: 2015-01-26 13:02 GMT+01:00 Marko Tiikkaja : I can see where it's a lot nicer not to have the context visible for people who only care about the contents of the message, but the way it's done in PL/PgSQL right now is just not good enough. On the other han

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-01-26 Thread Pavel Stehule
2015-01-26 13:02 GMT+01:00 Marko Tiikkaja : > On 1/22/15 6:03 PM, Pavel Stehule wrote: > >> 2015-01-22 12:37 GMT+01:00 Marko Tiikkaja : >> >>> Or is that a stupid idea? I just think hacking libpq for something like >>> this is a huge overkill. >>> >>> >> I don't think so only plpgsql solution is

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-01-26 Thread Marko Tiikkaja
On 1/22/15 6:03 PM, Pavel Stehule wrote: 2015-01-22 12:37 GMT+01:00 Marko Tiikkaja : Or is that a stupid idea? I just think hacking libpq for something like this is a huge overkill. I don't think so only plpgsql solution is satisfactory idea. There are some mix plpgsql / plperl ... applicat

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-01-22 Thread Pavel Stehule
2015-01-22 12:37 GMT+01:00 Marko Tiikkaja : > Hello, > > I just heard that there's going to be a fifth CF for 9.5 so I'm trying to > gather all the patches I'd like to see in 9.5.. > > On 8/23/13 10:36 AM, I wrote: > >> My opinion at this very moment is that we should leave the the DEFAULT >> verb

Re: [HACKERS] PL/pgSQL, RAISE and error context

2015-01-22 Thread Marko Tiikkaja
Hello, I just heard that there's going to be a fifth CF for 9.5 so I'm trying to gather all the patches I'd like to see in 9.5.. On 8/23/13 10:36 AM, I wrote: My opinion at this very moment is that we should leave the the DEFAULT verbosity alone and add a new one (call it COMPACT or such) wit

Re: [HACKERS] PL/pgSQL, RAISE and error context

2013-09-17 Thread Jeevan Chalke
Hi Marko, I have reviewed this patch. 1. Patch applies well. 2. make and make install is fine 3. make check is fine too. But as Peter pointed out plperl regression tests are failing. I just did grep on .sql files and found following files which has RAISE statement into it. These files too need

Re: [HACKERS] PL/pgSQL, RAISE and error context

2013-09-15 Thread Peter Eisentraut
On Sun, 2013-09-15 at 14:28 +0200, Marko Tiikkaja wrote: > On 15/09/2013 13:58, I wrote: > > Hmm. I just noticed there's something weird going on in the select_view > > test. I'm investigating this currently. > > Seems that there's some magic going on and I overwrote the expected > results of t

Re: [HACKERS] PL/pgSQL, RAISE and error context

2013-09-15 Thread Marko Tiikkaja
On 15/09/2013 13:50, I wrote: On 15/09/2013 04:05, Peter Eisentraut wrote: On Sat, 2013-09-14 at 04:58 +0200, Marko Tiikkaja wrote: The attached patch (based on Pavel's patch) changes the default to be slightly more verbose (the CONTEXT lines which were previously omitted will be visible), but

Re: [HACKERS] PL/pgSQL, RAISE and error context

2013-09-14 Thread Peter Eisentraut
On Sat, 2013-09-14 at 04:58 +0200, Marko Tiikkaja wrote: > The attached patch (based on Pavel's patch) changes the default to be > slightly more verbose (the CONTEXT lines which were previously > omitted > will be visible), but adds a new PGVerbosity called COMPACT which > suppresses CONTEXT in

Re: [HACKERS] PL/pgSQL, RAISE and error context

2013-09-14 Thread Pavel Stehule
2013/9/14 Marko Tiikkaja > On 23/08/2013 10:36, I wrote: > >> On 8/23/13 8:38 AM, Pavel Stehule wrote: >> >>> do you prepare patch ? >>> >> >> I should have the time to produce one for the September commitfest, but >> if you (or anyone else) want to work on this, I won't object. >> >> My opinion

Re: [HACKERS] PL/pgSQL, RAISE and error context

2013-09-13 Thread Marko Tiikkaja
On 23/08/2013 10:36, I wrote: On 8/23/13 8:38 AM, Pavel Stehule wrote: do you prepare patch ? I should have the time to produce one for the September commitfest, but if you (or anyone else) want to work on this, I won't object. My opinion at this very moment is that we should leave the the DE

Re: [HACKERS] PL/pgSQL, RAISE and error context

2013-08-23 Thread Pavel Stehule
2013/8/23 Marko Tiikkaja > On 8/23/13 8:38 AM, Pavel Stehule wrote: > > 2013/8/22 Marko Tiikkaja >> >>> I like the idea, but I think this should be a new verbosity level. With >>> this patch you would have to go full VERBOSE just to debug PL/pgSQL code >>> with NOTICEs and DEBUGs in it, and th

Re: [HACKERS] PL/pgSQL, RAISE and error context

2013-08-23 Thread Marko Tiikkaja
On 8/23/13 8:38 AM, Pavel Stehule wrote: 2013/8/22 Marko Tiikkaja I like the idea, but I think this should be a new verbosity level. With this patch you would have to go full VERBOSE just to debug PL/pgSQL code with NOTICEs and DEBUGs in it, and that output then becomes harder to parse with th

Re: [HACKERS] PL/pgSQL, RAISE and error context

2013-08-22 Thread Pavel Stehule
2013/8/22 Marko Tiikkaja > On 8/22/13 9:08 AM, Pavel Stehule wrote: > >> Probably we can introduce a new level of verbosity, but I am thinking so >> this behave is reasonable. Everybody who use a VERBOSE level expect lot of >> balast and it show expected info (context of error) >> >> Can be this

Re: [HACKERS] PL/pgSQL, RAISE and error context

2013-08-22 Thread Pavel Stehule
2013/8/22 Marko Tiikkaja > On 8/22/13 9:08 AM, Pavel Stehule wrote: > >> Probably we can introduce a new level of verbosity, but I am thinking so >> this behave is reasonable. Everybody who use a VERBOSE level expect lot of >> balast and it show expected info (context of error) >> >> Can be this

Re: [HACKERS] PL/pgSQL, RAISE and error context

2013-08-22 Thread Marko Tiikkaja
On 8/22/13 9:08 AM, Pavel Stehule wrote: Probably we can introduce a new level of verbosity, but I am thinking so this behave is reasonable. Everybody who use a VERBOSE level expect lot of balast and it show expected info (context of error) Can be this design good enough for you? I like the id

Re: [HACKERS] PL/pgSQL, RAISE and error context

2013-08-22 Thread Merlin Moncure
On Thu, Aug 22, 2013 at 2:08 AM, Pavel Stehule wrote: > Probably we can introduce a new level of verbosity, but I am thinking so > this behave is reasonable. Everybody who use a VERBOSE level expect lot of > balast and it show expected info (context of error) > > Can be this design good enough for

Re: [HACKERS] PL/pgSQL, RAISE and error context

2013-08-22 Thread Pavel Stehule
Hello I played with this topic little bit If I understand, the main problem is in console (or pgAdmin) output. create or replace function foo() returns void as $$ begin for i in 1..5 loop raise notice '> *'; end loop; raise exception '***'; end; $$ language plpgsq

Re: [HACKERS] PL/pgSQL, RAISE and error context

2013-08-21 Thread Merlin Moncure
On Wed, Aug 21, 2013 at 10:47 AM, Tom Lane wrote: > Merlin Moncure writes: >> On Wed, Aug 21, 2013 at 10:07 AM, Marko Tiikkaja wrote: >>> Why does \set VERBOSITY 'terse' not work for you? > >> Because it can't be controlled mid-function...that would suppress all >> context of errors as well as

Re: [HACKERS] PL/pgSQL, RAISE and error context

2013-08-21 Thread Tom Lane
Merlin Moncure writes: > On Wed, Aug 21, 2013 at 10:07 AM, Marko Tiikkaja wrote: >> Why does \set VERBOSITY 'terse' not work for you? > Because it can't be controlled mid-function...that would suppress all > context of errors as well as messages and so it's useless. Also psql > directives for

Re: [HACKERS] PL/pgSQL, RAISE and error context

2013-08-21 Thread Marko Tiikkaja
On 2013-08-21 17:18, Merlin Moncure wrote: On Wed, Aug 21, 2013 at 10:07 AM, Marko Tiikkaja wrote: Why does \set VERBOSITY 'terse' not work for you? Because it can't be controlled mid-function...that would suppress all context of errors as well as messages and so it's useless. Fair enough

Re: [HACKERS] PL/pgSQL, RAISE and error context

2013-08-21 Thread Pavel Stehule
2013/8/21 Merlin Moncure > On Wed, Aug 21, 2013 at 10:07 AM, Marko Tiikkaja wrote: > > On 8/21/13 5:05 PM, Merlin Moncure wrote: > >> > >> On Wed, Aug 21, 2013 at 9:22 AM, Tom Lane wrote: > >>> > >>> Marko Tiikkaja writes: > > By default, PL/pgSQL does not print the error context of

Re: [HACKERS] PL/pgSQL, RAISE and error context

2013-08-21 Thread Merlin Moncure
On Wed, Aug 21, 2013 at 10:07 AM, Marko Tiikkaja wrote: > On 8/21/13 5:05 PM, Merlin Moncure wrote: >> >> On Wed, Aug 21, 2013 at 9:22 AM, Tom Lane wrote: >>> >>> Marko Tiikkaja writes: By default, PL/pgSQL does not print the error context of a RAISE statement, for example: >>> >>

Re: [HACKERS] PL/pgSQL, RAISE and error context

2013-08-21 Thread Marko Tiikkaja
On 8/21/13 5:05 PM, Merlin Moncure wrote: On Wed, Aug 21, 2013 at 9:22 AM, Tom Lane wrote: Marko Tiikkaja writes: By default, PL/pgSQL does not print the error context of a RAISE statement, for example: It used to do so, in the beginning when we first added context-printing. There were comp

Re: [HACKERS] PL/pgSQL, RAISE and error context

2013-08-21 Thread Merlin Moncure
On Wed, Aug 21, 2013 at 9:22 AM, Tom Lane wrote: > Marko Tiikkaja writes: >> By default, PL/pgSQL does not print the error context of a RAISE >> statement, for example: > > It used to do so, in the beginning when we first added context-printing. > There were complaints that the result was too ver

Re: [HACKERS] PL/pgSQL, RAISE and error context

2013-08-21 Thread Marko Tiikkaja
On 8/21/13 4:22 PM, Tom Lane wrote: Marko Tiikkaja writes: By default, PL/pgSQL does not print the error context of a RAISE statement, for example: It used to do so, in the beginning when we first added context-printing. There were complaints that the result was too verbose; for instance if y

Re: [HACKERS] PL/pgSQL, RAISE and error context

2013-08-21 Thread Tom Lane
Marko Tiikkaja writes: > By default, PL/pgSQL does not print the error context of a RAISE > statement, for example: It used to do so, in the beginning when we first added context-printing. There were complaints that the result was too verbose; for instance if you had a RAISE NOTICE inside a loop

  1   2   >