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,

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

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

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 >

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-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.

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

2015-08-13 Thread Pavel Stehule
Hi 2015-08-12 11:07 GMT+02:00 Marko Tiikkaja ma...@joh.to: 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

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

2015-08-12 Thread Pavel Stehule
2015-08-10 18:43 GMT+02:00 Pavel Stehule pavel.steh...@gmail.com: 2015-08-10 9:11 GMT+02:00 Heikki Linnakangas hlinn...@iki.fi: 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

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-12 11:07 GMT+02:00 Marko Tiikkaja ma...@joh.to: 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

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

2015-08-10 Thread Pavel Stehule
2015-08-10 9:11 GMT+02:00 Heikki Linnakangas hlinn...@iki.fi: 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 -

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

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

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

2015-07-25 Thread Pavel Stehule
2015-07-21 16:58 GMT+02:00 Merlin Moncure mmonc...@gmail.com: On Tue, Jul 21, 2015 at 2:53 AM, Heikki Linnakangas hlinn...@iki.fi 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

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

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 hlinn...@iki.fi 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

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,

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

2015-07-21 Thread Pavel Stehule
2015-07-21 9:53 GMT+02:00 Heikki Linnakangas hlinn...@iki.fi: 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

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

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

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

2015-07-09 Thread Pavel Stehule
2015-07-09 15:17 GMT+02:00 Merlin Moncure mmonc...@gmail.com: On Wed, Jul 8, 2015 at 11:28 PM, Pavel Stehule pavel.steh...@gmail.com wrote: Hi second version of this patch make check-world passed quickly scanning the patch, the implementation is trivial (minus regression test

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 pavel.steh...@gmail.com wrote: 2015-07-09 15:17 GMT+02:00 Merlin Moncure mmonc...@gmail.com: On Wed, Jul 8, 2015 at 11:28 PM, Pavel Stehule pavel.steh...@gmail.com wrote: Hi second version of this patch make check-world passed quickly

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 pavel.steh...@gmail.com 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

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

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

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 pavel.steh...@gmail.com wrote: 2015-07-09 20:08 GMT+02:00 Merlin Moncure mmonc...@gmail.com: On Thu, Jul 9, 2015 at 10:48 AM, Pavel Stehule pavel.steh...@gmail.com wrote: 2015-07-09 15:17 GMT+02:00 Merlin Moncure mmonc...@gmail.com: On

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 pavel.steh...@gmail.com wrote: 2015-07-07 18:15 GMT+02:00 Merlin Moncure mmonc...@gmail.com: On Tue, Jul 7, 2015 at 9:04 AM, Pavel Stehule pavel.steh...@gmail.com wrote: It doesn't have to if the behavior is guarded with a GUC. I just don't

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 pavel.steh...@gmail.com wrote: 2015-07-08 8:35 GMT+02:00 Pavel Stehule pavel.steh...@gmail.com: 2015-07-07 18:15 GMT+02:00 Merlin Moncure mmonc...@gmail.com: On Tue, Jul 7, 2015 at 9:04 AM, Pavel Stehule pavel.steh...@gmail.com wrote: It

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

2015-07-08 Thread Pavel Stehule
2015-07-08 8:35 GMT+02:00 Pavel Stehule pavel.steh...@gmail.com: 2015-07-07 18:15 GMT+02:00 Merlin Moncure mmonc...@gmail.com: On Tue, Jul 7, 2015 at 9:04 AM, Pavel Stehule pavel.steh...@gmail.com wrote: It doesn't have to if the behavior is guarded with a GUC. I just don't understand

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

2015-07-08 Thread Pavel Stehule
2015-07-08 23:46 GMT+02:00 Merlin Moncure mmonc...@gmail.com: On Wed, Jul 8, 2015 at 4:39 PM, Pavel Stehule pavel.steh...@gmail.com wrote: 2015-07-08 8:35 GMT+02:00 Pavel Stehule pavel.steh...@gmail.com: 2015-07-07 18:15 GMT+02:00 Merlin Moncure mmonc...@gmail.com: On Tue, Jul 7,

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

2015-07-08 Thread Pavel Stehule
2015-07-07 18:15 GMT+02:00 Merlin Moncure mmonc...@gmail.com: On Tue, Jul 7, 2015 at 9:04 AM, Pavel Stehule pavel.steh...@gmail.com 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

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

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 pavel.steh...@gmail.com 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

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

2015-07-07 Thread Pavel Stehule
2015-07-07 18:15 GMT+02:00 Merlin Moncure mmonc...@gmail.com: On Tue, Jul 7, 2015 at 9:04 AM, Pavel Stehule pavel.steh...@gmail.com 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

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

2015-07-07 Thread Pavel Stehule
2015-07-07 15:56 GMT+02:00 Merlin Moncure mmonc...@gmail.com: On Tue, Jul 7, 2015 at 8:13 AM, Heikki Linnakangas hlinn...@iki.fi wrote: On 01/26/2015 05:14 PM, Tom Lane wrote: Pavel Stehule pavel.steh...@gmail.com writes: 2015-01-26 14:02 GMT+01:00 Marko Tiikkaja ma...@joh.to: I am

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 pavel.steh...@gmail.com writes: 2015-01-26 14:02 GMT+01:00 Marko Tiikkaja ma...@joh.to: I am thinking, so solution /* if we are doing RAISE, don't report its location */ if (estate-err_text == raise_skip_msg) return;

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 hlinn...@iki.fi wrote: On 01/26/2015 05:14 PM, Tom Lane wrote: Pavel Stehule pavel.steh...@gmail.com writes: 2015-01-26 14:02 GMT+01:00 Marko Tiikkaja ma...@joh.to: I am thinking, so solution /* if we are doing RAISE, don't report

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 hlinn...@iki.fi wrote: On 01/26/2015 05:14 PM, Tom Lane wrote: Pavel Stehule pavel.steh...@gmail.com writes: 2015-01-26 14:02 GMT+01:00 Marko Tiikkaja ma...@joh.to: I am thinking, so solution

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

2015-04-30 Thread Pavel Stehule
2015-04-30 10:24 GMT+02:00 Marko Tiikkaja ma...@joh.to: 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

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

2015-04-30 Thread Pavel Stehule
2015-04-28 19:44 GMT+02:00 Jim Nasby jim.na...@bluetreble.com: 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

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 $$

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

2015-04-30 Thread Pavel Stehule
2015-04-30 10:50 GMT+02:00 Pavel Stehule pavel.steh...@gmail.com: 2015-04-30 10:24 GMT+02:00 Marko Tiikkaja ma...@joh.to: 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

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-28 Thread Pavel Stehule
2015-04-27 22:53 GMT+02:00 Jim Nasby jim.na...@bluetreble.com: On 4/27/15 11:47 AM, Joel Jacobson wrote: On Mon, Apr 27, 2015 at 6:14 PM, Marko Tiikkaja ma...@joh.to mailto:ma...@joh.to wrote: That sounds weird. log_min_messages are the messages sent to the log;

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 ma...@joh.to 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

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

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

2015-04-27 Thread Pavel Stehule
2015-04-27 16:05 GMT+02:00 Joel Jacobson j...@trustly.com: 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

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 pavel.steh...@gmail.com 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

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 pavel.steh...@gmail.com 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, --

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 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, whatever that would mean. Good point. I think it can't be

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 pavel.steh...@gmail.com: Hi 2015-04-24 19:16 GMT+02:00 Joel

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 j...@trustly.com: On Fri, Apr 24, 2015 at 6:07 PM, Pavel Stehule pavel.steh...@gmail.com wrote: Example: context_messages = -warning, -error, +notice I prefer your first proposal - and there is a precedent for plpgsql -

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 pavel.steh...@gmail.com wrote: Hi 2015-04-24 19:16 GMT+02:00 Joel Jacobson j...@trustly.com: On Fri, Apr 24, 2015 at 6:07 PM, Pavel Stehule pavel.steh...@gmail.com wrote: Example: context_messages = -warning, -error, +notice I

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

2015-04-24 Thread Pavel Stehule
2015-04-24 12:11 GMT+02:00 Joel Jacobson j...@trustly.com: 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

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

2015-04-24 Thread Pavel Stehule
2015-04-24 13:16 GMT+02:00 Robert Haas robertmh...@gmail.com: On Fri, Apr 24, 2015 at 6:11 AM, Joel Jacobson j...@trustly.com 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

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

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 j...@trustly.com 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

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 robertmh...@gmail.com 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

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

2015-04-24 Thread Pavel Stehule
2015-04-24 16:02 GMT+02:00 Joel Jacobson j...@trustly.com: On Fri, Apr 24, 2015 at 1:16 PM, Robert Haas robertmh...@gmail.com wrote: This would allow doing something crazy as: suppress_context_messages = warning,error display_context_messages = notice This is a very flexible

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 pavel.steh...@gmail.com 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

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

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

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

2015-04-23 Thread Pavel Stehule
2015-04-23 16:12 GMT+02:00 Robert Haas robertmh...@gmail.com: On Thu, Apr 23, 2015 at 9:55 AM, Pavel Stehule pavel.steh...@gmail.com wrote: On Thu, Apr 23, 2015 at 4:56 AM, Pavel Stehule pavel.steh...@gmail.com wrote: I don't see a contradiction. There is clean agreement, so ERROR

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

2015-04-23 Thread Pavel Stehule
2015-04-23 15:47 GMT+02:00 Robert Haas robertmh...@gmail.com: On Thu, Apr 23, 2015 at 4:56 AM, Pavel Stehule pavel.steh...@gmail.com 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

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 pavel.steh...@gmail.com wrote: On Thu, Apr 23, 2015 at 4:56 AM, Pavel Stehule pavel.steh...@gmail.com 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

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

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

2015-04-23 Thread Pavel Stehule
2015-04-23 9:53 GMT+02:00 Marko Tiikkaja ma...@joh.to: 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

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 pavel.steh...@gmail.com 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

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

2015-04-02 Thread Pavel Stehule
2015-01-26 16:46 GMT+01:00 Pavel Stehule pavel.steh...@gmail.com: 2015-01-26 16:14 GMT+01:00 Tom Lane t...@sss.pgh.pa.us: Pavel Stehule pavel.steh...@gmail.com writes: 2015-01-26 14:02 GMT+01:00 Marko Tiikkaja ma...@joh.to: I am thinking, so solution /* if we are doing RAISE,

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 ma...@joh.to: 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

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 ma...@joh.to: 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

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

2015-01-26 Thread Pavel Stehule
2015-01-26 13:39 GMT+01:00 Marko Tiikkaja ma...@joh.to: On 1/26/15 1:14 PM, Pavel Stehule wrote: 2015-01-26 13:02 GMT+01:00 Marko Tiikkaja ma...@joh.to: 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

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

2015-01-26 Thread Tom Lane
Pavel Stehule pavel.steh...@gmail.com writes: 2015-01-26 14:02 GMT+01:00 Marko Tiikkaja ma...@joh.to: 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

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

2015-01-26 Thread Pavel Stehule
2015-01-26 16:14 GMT+01:00 Tom Lane t...@sss.pgh.pa.us: Pavel Stehule pavel.steh...@gmail.com writes: 2015-01-26 14:02 GMT+01:00 Marko Tiikkaja ma...@joh.to: I am thinking, so solution /* if we are doing RAISE, don't report its location */ if (estate-err_text == raise_skip_msg)

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

2015-01-26 Thread Pavel Stehule
2015-01-26 14:02 GMT+01:00 Marko Tiikkaja ma...@joh.to: On 1/26/15 1:44 PM, Pavel Stehule wrote: 2015-01-26 13:39 GMT+01:00 Marko Tiikkaja ma...@joh.to: 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

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 Marko Tiikkaja
On 1/22/15 6:03 PM, Pavel Stehule wrote: 2015-01-22 12:37 GMT+01:00 Marko Tiikkaja ma...@joh.to: 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

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

2015-01-26 Thread Pavel Stehule
2015-01-26 13:02 GMT+01:00 Marko Tiikkaja ma...@joh.to: On 1/22/15 6:03 PM, Pavel Stehule wrote: 2015-01-22 12:37 GMT+01:00 Marko Tiikkaja ma...@joh.to: 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

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)

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

2015-01-22 Thread Pavel Stehule
2015-01-22 12:37 GMT+01:00 Marko Tiikkaja ma...@joh.to: 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

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 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-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 the

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

2013-09-14 Thread Pavel Stehule
2013/9/14 Marko Tiikkaja ma...@joh.to 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

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-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

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

2013-08-23 Thread Pavel Stehule
2013/8/22 Marko Tiikkaja ma...@joh.to 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-23 Thread Marko Tiikkaja
On 8/23/13 8:38 AM, Pavel Stehule wrote: 2013/8/22 Marko Tiikkaja ma...@joh.to 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

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

2013-08-23 Thread Pavel Stehule
2013/8/23 Marko Tiikkaja ma...@joh.to On 8/23/13 8:38 AM, Pavel Stehule wrote: 2013/8/22 Marko Tiikkaja ma...@joh.to 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

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 plpgsql;

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 pavel.steh...@gmail.com 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

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

2013-08-22 Thread Pavel Stehule
2013/8/22 Marko Tiikkaja ma...@joh.to 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

[HACKERS] PL/pgSQL, RAISE and error context

2013-08-21 Thread Marko Tiikkaja
Hi, By default, PL/pgSQL does not print the error context of a RAISE statement, for example: =# create function foof() returns void as $$ begin raise exception 'foo'; end $$ language plpgsql; CREATE FUNCTION =# create function bar() returns void as $$ begin perform foof(); end $$ language

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

2013-08-21 Thread Pavel Stehule
2013/8/21 Marko Tiikkaja ma...@joh.to Hi, By default, PL/pgSQL does not print the error context of a RAISE statement, for example: =# create function foof() returns void as $$ begin raise exception 'foo'; end $$ language plpgsql; CREATE FUNCTION =# create function bar() returns void as

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

2013-08-21 Thread Marko Tiikkaja
On 8/21/13 2:28 PM, I wrote: By default, PL/pgSQL does not print the error context of a RAISE statement, for example: An even worse example: =# create function foof() returns void as $$ begin raise exception 'foo'; end $$ language plpgsql; CREATE FUNCTION =# create function barf() returns

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

2013-08-21 Thread Tom Lane
Marko Tiikkaja ma...@joh.to 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

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 ma...@joh.to 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

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 t...@sss.pgh.pa.us wrote: Marko Tiikkaja ma...@joh.to 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

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 t...@sss.pgh.pa.us wrote: Marko Tiikkaja ma...@joh.to 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

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 ma...@joh.to wrote: On 8/21/13 5:05 PM, Merlin Moncure wrote: On Wed, Aug 21, 2013 at 9:22 AM, Tom Lane t...@sss.pgh.pa.us wrote: Marko Tiikkaja ma...@joh.to writes: By default, PL/pgSQL does not print the error context of a RAISE statement,

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

2013-08-21 Thread Pavel Stehule
2013/8/21 Merlin Moncure mmonc...@gmail.com On Wed, Aug 21, 2013 at 10:07 AM, Marko Tiikkaja ma...@joh.to wrote: On 8/21/13 5:05 PM, Merlin Moncure wrote: On Wed, Aug 21, 2013 at 9:22 AM, Tom Lane t...@sss.pgh.pa.us wrote: Marko Tiikkaja ma...@joh.to writes: By default, PL/pgSQL

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 ma...@joh.to 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.

  1   2   >