Обсуждение: warn in plperl logs as... NOTICE??
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 ofodd, but at least nowhere near as surprising as warn becoming NOTICE... -- Jim C. Nasby, Database Architect jim@nasby.net 512.569.9461 (cell) http://jim.nasby.net
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 ofodd, 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
Andrew Dunstan <andrew@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
Tom Lane wrote: > Andrew Dunstan <andrew@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
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 havecertainly found over the years that perl warnings from some modules can be annoyingly verbose, which is probably whythe original patch didn't make them have a higher level in Postgres. If this were a big issue we'd have surely heard aboutit before now - there are plenty of plperl users out there. Using elog(WARNING) certainly makes a lot more sense to me… David
On Thu, Jan 21, 2010 at 07:55:09PM -0500, Andrew Dunstan wrote: > Tom Lane wrote: > >Andrew Dunstan <andrew@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.
On Jan 22, 2010, at 2:55 AM, Andrew Dunstan wrote: > > > Tom Lane wrote: >> Andrew Dunstan <andrew@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 thewarning 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 havecertainly found over the years that perl warnings from some modules can be annoyingly verbose, which is probably whythe original patch didn't make them have a higher level in Postgres. If this were a big issue we'd have surely heard aboutit 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 thedocumentation :) -- Alexey Klyukin http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc
On Fri, Jan 22, 2010 at 9:13 AM, Alexey Klyukin <alexk@waki.ru> wrote: > I think elog(WARNING) is less surprising for the end-user, unless there's an objection strong enough to include it intothe 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
-----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 greg@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-----
On Jan 22, 2010, at 4:38 PM, Robert Haas wrote: > On Fri, Jan 22, 2010 at 9:13 AM, Alexey Klyukin <alexk@waki.ru> wrote: >> I think elog(WARNING) is less surprising for the end-user, unless there's an objection strong enough to include it intothe 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 unhappyusers in the future (if we admit the fact that this behavior is illogical). IMO if something behaves counterintuitivelyto most users the behavior should be at least documented, if not fixed. -- Alexey Klyukin http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc
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 <alexk@waki.ru> wrote: >> >>> I think elog(WARNING) is less surprising for the end-user, unless there's an objection strong enough to include it intothe 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 unhappyusers in the future (if we admit the fact that this behavior is illogical). IMO if something behaves counterintuitivelyto 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