Re: [HACKERS] warn in plperl logs as... NOTICE??

2010-01-22 Thread Tim Bunce
On Thu, Jan 21, 2010 at 07:55:09PM -0500, Andrew Dunstan wrote:
 Tom Lane wrote:
 Andrew Dunstan and...@dunslane.net writes:
 Jim Nasby wrote:
 Why does warn; in plperl log as NOTICE in Postgres?
 
 Where would you like the warning to go? This has been this way
 for nearly 5 years, it's not new (and before that the warning
 didn't go anywhere).
 
 I think he's suggesting that it ought to translate as elog(WARNING)
 not elog(NOTICE).
 
 *shrug* I don't have a strong opinion about it, and it's pretty easy
 to change, if there's a consensus we should. I have certainly found
 over the years that perl warnings from some modules can be
 annoyingly verbose, which is probably why the original patch didn't
 make them have a higher level in Postgres. If this were a big issue
 we'd have surely heard about it before now - there are plenty of
 plperl users out there.

I've no particular opinion either way on this. I can't resist the
tempation, however, to point out that this is an example the kind of
site-preference that could be handled via plperl.on_perl_init:

plperl.on_perl_init='$SIG{__WARN__} = sub { elog(WARNING, shift) }'
or
plperl.on_perl_init='use lib /MyApp/lib; use MyApp::PLPerlInit;'

You could get more fancy and employ some logic to using WARNING for the
first instance of any given message text and NOTICE for subsequent ones.

Tim.

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] warn in plperl logs as... NOTICE??

2010-01-22 Thread Alexey Klyukin

On Jan 22, 2010, at 2:55 AM, Andrew Dunstan wrote:

 
 
 Tom Lane wrote:
 Andrew Dunstan and...@dunslane.net writes:
  
 Jim Nasby wrote:

 Why does warn; in plperl log as NOTICE in Postgres?
  
 
  
 Where would you like the warning to go? This has been this way for nearly 5 
 years, it's not new (and before that the warning didn't go anywhere).

 
 I think he's suggesting that it ought to translate as elog(WARNING)
 not elog(NOTICE).
 
  
  
 
 *shrug* I don't have a strong opinion about it, and it's pretty easy to 
 change, if there's a consensus we should. I have certainly found over the 
 years that perl warnings from some modules can be annoyingly verbose, which 
 is probably why the original patch didn't make them have a higher level in 
 Postgres. If this were a big issue we'd have surely heard about it before now 
 - there are plenty of plperl users out there.

I think elog(WARNING) is less surprising for the end-user, unless there's an 
objection strong enough to include it into the documentation :)

--
Alexey Klyukin  http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] warn in plperl logs as... NOTICE??

2010-01-22 Thread Robert Haas
On Fri, Jan 22, 2010 at 9:13 AM, Alexey Klyukin al...@waki.ru wrote:
 I think elog(WARNING) is less surprising for the end-user, unless there's an 
 objection strong enough to include it into the documentation :)

I think the main possible objection would what Simon just wrote on the
other thread - that it's been this way for a while, and while someone
might think that a different decision about how to handle it would
have been better, there may be people counting on the current behavior
who will have to spend time and perhaps money making changes if we
change it.

...Robert

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] warn in plperl logs as... NOTICE??

2010-01-22 Thread Greg Sabino Mullane

-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160

 Why does warn; in plperl log as NOTICE in Postgres?

 *shrug* I don't have a strong opinion about it, and it's pretty easy to
 change, if there's a consensus we should. I have certainly found over
 the years that perl warnings from some modules can be annoyingly
 verbose, which is probably why the original patch didn't make them have
 a higher level in Postgres. If this were a big issue we'd have surely
 heard about it before now - there are plenty of plperl users out there.

As a heavy user of Pl/Perl[U], this behavior has always surprised me,
but never enough to bother complaining about it. However, count me
as a +1 to make warn == elog(WARNING)

- --
Greg Sabino Mullane g...@turnstep.com
End Point Corporation http://www.endpoint.com/
PGP Key: 0x14964AC8 201001220941
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-BEGIN PGP SIGNATURE-

iEYEAREDAAYFAktZuUEACgkQvJuQZxSWSsji4gCgwR8UEE4CimL8tAKnu0ZU+y+w
nxkAn3MCOVCGr6BuCiRcjxrQ2/KCe/Bn
=5Ukn
-END PGP SIGNATURE-



-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] warn in plperl logs as... NOTICE??

2010-01-22 Thread Alexey Klyukin

On Jan 22, 2010, at 4:38 PM, Robert Haas wrote:

 On Fri, Jan 22, 2010 at 9:13 AM, Alexey Klyukin al...@waki.ru wrote:
 I think elog(WARNING) is less surprising for the end-user, unless there's an 
 objection strong enough to include it into the documentation :)
 
 I think the main possible objection would what Simon just wrote on the
 other thread - that it's been this way for a while, and while someone
 might think that a different decision about how to handle it would
 have been better, there may be people counting on the current behavior
 who will have to spend time and perhaps money making changes if we
 change it.

Well, then we have to choose between a fixed number of unhappy users in the 
past and potentially increasing number of unhappy users in the future (if we 
admit the fact that this behavior is illogical).  IMO if something behaves 
counterintuitively to most users the behavior should be at least documented, if 
not fixed.  

--
Alexey Klyukin  http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] warn in plperl logs as... NOTICE??

2010-01-22 Thread Andrew Dunstan



Alexey Klyukin wrote:

On Jan 22, 2010, at 4:38 PM, Robert Haas wrote:

  

On Fri, Jan 22, 2010 at 9:13 AM, Alexey Klyukin al...@waki.ru wrote:


I think elog(WARNING) is less surprising for the end-user, unless there's an 
objection strong enough to include it into the documentation :)
  

I think the main possible objection would what Simon just wrote on the
other thread - that it's been this way for a while, and while someone
might think that a different decision about how to handle it would
have been better, there may be people counting on the current behavior
who will have to spend time and perhaps money making changes if we
change it.



Well, then we have to choose between a fixed number of unhappy users in the past and potentially increasing number of unhappy users in the future (if we admit the fact that this behavior is illogical).  IMO if something behaves counterintuitively to most users the behavior should be at least documented, if not fixed.  



  


Well, as Tim Bunce pointed out, if we get his on_init patch users would 
be able to choose which behaviour they wanted. So we don't necessarily 
have to choose between what people think conforms to POLA and backwards 
compatibility.


Right now I'm a bit hung on that patch because of the lost GUC 
placeholder issue mentioned elsewhere - everything I have thought of so 
far that might overcome it has been unspeakably ugly :-(


cheers

andrew

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


[HACKERS] warn in plperl logs as... NOTICE??

2010-01-21 Thread Jim Nasby
Why does warn; in plperl log as NOTICE in Postgres?

On a related note, what's the logic behind perl DEBUG logging as DEBUG2 instead 
of DEBUG1 or DEBUG5? Still seems kind of odd, but at least nowhere near as 
surprising as warn becoming NOTICE...
--
Jim C. Nasby, Database Architect   j...@nasby.net
512.569.9461 (cell) http://jim.nasby.net



-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] warn in plperl logs as... NOTICE??

2010-01-21 Thread Andrew Dunstan



Jim Nasby wrote:

Why does warn; in plperl log as NOTICE in Postgres?

On a related note, what's the logic behind perl DEBUG logging as DEBUG2 instead 
of DEBUG1 or DEBUG5? Still seems kind of odd, but at least nowhere near as 
surprising as warn becoming NOTICE...

  


Where would you like the warning to go? This has been this way for 
nearly 5 years, it's not new (and before that the warning didn't go 
anywhere).


cheers

andrew

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] warn in plperl logs as... NOTICE??

2010-01-21 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes:
 Jim Nasby wrote:
 Why does warn; in plperl log as NOTICE in Postgres?

 Where would you like the warning to go? This has been this way for 
 nearly 5 years, it's not new (and before that the warning didn't go 
 anywhere).

I think he's suggesting that it ought to translate as elog(WARNING)
not elog(NOTICE).

regards, tom lane

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] warn in plperl logs as... NOTICE??

2010-01-21 Thread Andrew Dunstan



Tom Lane wrote:

Andrew Dunstan and...@dunslane.net writes:
  

Jim Nasby wrote:


Why does warn; in plperl log as NOTICE in Postgres?
  


  
Where would you like the warning to go? This has been this way for 
nearly 5 years, it's not new (and before that the warning didn't go 
anywhere).



I think he's suggesting that it ought to translate as elog(WARNING)
not elog(NOTICE).


  


*shrug* I don't have a strong opinion about it, and it's pretty easy to 
change, if there's a consensus we should. I have certainly found over 
the years that perl warnings from some modules can be annoyingly 
verbose, which is probably why the original patch didn't make them have 
a higher level in Postgres. If this were a big issue we'd have surely 
heard about it before now - there are plenty of plperl users out there.


cheers

andrew

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] warn in plperl logs as... NOTICE??

2010-01-21 Thread David E. Wheeler
On Jan 21, 2010, at 4:55 PM, Andrew Dunstan wrote:

 *shrug* I don't have a strong opinion about it, and it's pretty easy to 
 change, if there's a consensus we should. I have certainly found over the 
 years that perl warnings from some modules can be annoyingly verbose, which 
 is probably why the original patch didn't make them have a higher level in 
 Postgres. If this were a big issue we'd have surely heard about it before now 
 - there are plenty of plperl users out there.

Using elog(WARNING) certainly makes a lot more sense to me…

David
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers