Suppress 'duplicate key' at errorlog?
Suppress 'duplicate key' at errorlog?
Hi,
Is there a way to suppress a ‘duplicate key’ msg from the errorlog? Due to a bug in a 3rd party application, this keeps on appearing and I am concerned that it will fill up the filesystem. I can delete the old errorlog, but if there is any other meaningful msgs out there, I would lose that too.
Thanks.
Maria
Re: Suppress 'duplicate key' at errorlog?
Hi,
Is there a way to suppress a ‘duplicate key’ msg from the errorlog? Due to a bug in a 3rd party application, this keeps on appearing and I am concerned that it will fill up the filesystem. I can delete the old errorlog, but if there is any other meaningful msgs out there, I would lose that too.
Thanks.
Maria
Re: Suppress 'duplicate key' at errorlog?
I _do_ want to phone in on the whole duplicate key issue.
Sure, this could be a race condition. It could be bad programming. It could be a variety of things.
You ABSOLUTELY do not want to ignore that. Ignoring and moving on will cause consistency problems. Catch it and add it to a log or an email. Continue.
Do NOT silently ignore something trying to add a duplicate key.
Hi,
Is there a way to suppress a ‘duplicate key’ msg from the errorlog? Due to a bug in a 3rd party application, this keeps on appearing and I am concerned that it will fill up the filesystem. I can delete the old errorlog, but if there is any other meaningful msgs out there, I would lose that too.
Thanks.
Maria
Not in any way that doesn't also entail the "but if there is any other meaningful msgs out there, I would lose that too." risk.Stop thinking about the limited problem of removing the excessive messages and just learn how to deal with high-volume log situations generally. At worse you could a simple log rotation and archive with a cleanup "sed" script that deletes these messages. Suggest setting "application_name" in order to be more targeted.David J.
Re: Suppress 'duplicate key' at errorlog?
On Mon, Mar 30, 2015 at 5:45 PM, David G. Johnston <david.g.johnston@gmail.com> wrote:Hi,
Is there a way to suppress a ‘duplicate key’ msg from the errorlog? Due to a bug in a 3rd party application, this keeps on appearing and I am concerned that it will fill up the filesystem. I can delete the old errorlog, but if there is any other meaningful msgs out there, I would lose that too.
Thanks.
Maria
Not in any way that doesn't also entail the "but if there is any other meaningful msgs out there, I would lose that too." risk.Stop thinking about the limited problem of removing the excessive messages and just learn how to deal with high-volume log situations generally. At worse you could a simple log rotation and archive with a cleanup "sed" script that deletes these messages. Suggest setting "application_name" in order to be more targeted.David J.
I _do_ want to phone in on the whole duplicate key issue.
Sure, this could be a race condition. It could be bad programming. It could be a variety of things.
You ABSOLUTELY do not want to ignore that. Ignoring and moving on will cause consistency problems. Catch it and add it to a log or an email. Continue.
Do NOT silently ignore something trying to add a duplicate key.
Re: Suppress 'duplicate key' at errorlog?
On Mar 30, 2015, at 3:03 PM, Rossi, Maria wrote: > > Hi, > > Is there a way to suppress a ‘duplicate key’ msg from the errorlog? Due to a bug in a 3rd party application, this keeps on appearing and I am concerned that it will fill up the filesystem. I can delete the old errorlog, but if there is any other meaningful msgs out there, I would lose that too. No way to turn off that specific error message, but you could filter them out of the log, being careful of course not to filter any messages which might be more meaningful. You could also prevent the errors from being raised by using a trigger, but I don't like that idea very much at all. -- Scott Ribe scott_ribe@elevated-dev.com http://www.elevated-dev.com/ https://www.linkedin.com/in/scottribe/ (303) 722-0567 voice
Re: Suppress 'duplicate key' at errorlog?
Am I the only one concerned about a product trying to duplicate a pkey? This is not usually the LAST step. It's early on in the logical process. You have to find and solve the underlying cause.
On Mar 30, 2015, at 3:03 PM, Rossi, Maria <maria.rossi@us.pgds.com> wrote:
>
> Hi,
>
> Is there a way to suppress a ‘duplicate key’ msg from the errorlog? Due to a bug in a 3rd party application, this keeps on appearing and I am concerned that it will fill up the filesystem. I can delete the old errorlog, but if there is any other meaningful msgs out there, I would lose that too.
No way to turn off that specific error message, but you could filter them out of the log, being careful of course not to filter any messages which might be more meaningful. You could also prevent the errors from being raised by using a trigger, but I don't like that idea very much at all.
--
Scott Ribe
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
https://www.linkedin.com/in/scottribe/
(303) 722-0567 voice
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Re: Suppress 'duplicate key' at errorlog?
Scott Whitney writes: > Am I the only one concerned about a product trying to duplicate a pkey? This is not usually the LAST step. It's early on in the logical process. You have to find and > solve the underlying cause. I've seen lazy developers use a try insert/update if fail to implement a poor man's upsert... a feature much sought after and only now being seriously developed for Postgres. So... whether or not it's a bug is application dependent. Yes I'd question a 3rd party about this if the product wasn't developed in house and/or fully open to code review to have them tell me "we did it that way on purpose" though rather than just declaring it a nuisance. FWIW > On Mon, Mar 30, 2015 at 6:17 PM, Scott Ribe wrote: > > On Mar 30, 2015, at 3:03 PM, Rossi, Maria wrote: > > > > Hi, > > > > Is there a way to suppress a âduplicate keyâ msg from the errorlog? Due to a bug in a 3rd party application, this keeps on appearing and I am concerned that it > will fill up the filesystem. I can delete the old errorlog, but if there is any other meaningful msgs out there, I would lose that too. > > No way to turn off that specific error message, but you could filter them out of the log, being careful of course not to filter any messages which might be more > meaningful. You could also prevent the errors from being raised by using a trigger, but I don't like that idea very much at all. > > -- > Scott Ribe > scott_ribe@elevated-dev.com > http://www.elevated-dev.com/ > https://www.linkedin.com/in/scottribe/ > (303) 722-0567 voice > > -- > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-admin > -- Jerry Sievers Postgres DBA/Development Consulting e: postgres.consulting@comcast.net p: 312.241.7800
Re: Suppress 'duplicate key' at errorlog?
Thanks for all the comments/suggestions. As I mentioned, this is a 3rd-party software so what I can do to it is none or limited at best. I will try to filter the errorlog. Another option is to set the log_min_messages and log_min_error_statement to log. Maria -----Original Message----- From: Jerry Sievers [mailto:gsievers19@comcast.net] Sent: Monday, March 30, 2015 8:54 PM To: Scott Whitney Cc: Scott Ribe; Rossi, Maria; pgsql-admin@postgresql.org Subject: Re: [ADMIN] Suppress 'duplicate key' at errorlog? Scott Whitney writes: > Am I the only one concerned about a product trying to duplicate a > pkey? This is not usually the LAST step. It's early on in the logical process. You have to find and solve the underlying cause. I've seen lazy developers use a try insert/update if fail to implement a poor man's upsert... a feature much sought after and only now being seriously developed for Postgres. So... whether or not it's a bug is application dependent. Yes I'd question a 3rd party about this if the product wasn't developed in house and/or fully open to code review to have them tell me "we did it that way on purpose" though rather than just declaring it a nuisance. FWIW > On Mon, Mar 30, 2015 at 6:17 PM, Scott Ribe wrote: > > On Mar 30, 2015, at 3:03 PM, Rossi, Maria wrote: > > > > Hi, > > > > Is there a way to suppress a ‘duplicate key’ msg from the errorlog? Due to a bug in a 3rd party application, this keeps on appearing and I am concerned that it > will fill up the filesystem. I can delete the old errorlog, but if there is any other meaningful msgs out there, I would lose that too. > > No way to turn off that specific error message, but you could filter them out of the log, being careful of course not to filter any messages which might be more > meaningful. You could also prevent the errors from being raised by using a trigger, but I don't like that idea very much at all. > > -- > Scott Ribe > scott_ribe@elevated-dev.com > http://www.elevated-dev.com/ > https://www.linkedin.com/in/scottribe/ > (303) 722-0567 voice > > -- > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-admin > -- Jerry Sievers Postgres DBA/Development Consulting e: postgres.consulting@comcast.net p: 312.241.7800