Re: duplicate key errors in log file

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: anj patnaik <patna73(at)gmail(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: duplicate key errors in log file
Date: 2015-11-21 06:00:08
Message-ID: 56500868.2090900@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/18/15 2:42 PM, Jeff Janes wrote:
> But he already knows it has race conditions. That is why he included
> retry logic, to deal with those conditions.

From the sounds of it there's no retry loop, which means there's still
a race condition (data is deleted after insert fails but before update).

>> >Even if you got rid of
>> >those, the overhead of the back-and-forth with the database is huge compared
>> >to doing this in the database.
>> >
>> >So really you should create a plpgsql function ala example 40-2 at
>> >http://www.postgresql.org/docs/9.4/static/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING
> It is pretty heavy handed to have to learn yet another language just
> to deal with some rare condition which can be handled fine with one of
> the languages you already know.

Meh. Not like there's that much to learning plpgsql if you already know
plpgsql.

> I would certainly welcome an optional way to turn off server logging
> of errors of a racy nature, while still have things like syntax errors
> get logged.

Really we need much more granular logging control, period. The lack of
it makes RAISE DEBUG in anything but the most trivial environments
completely useless.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jim Nasby 2015-11-21 06:13:15 Re: postgres zeroization of dead tuples ? i.e scrubbing dead tuples with sensitive data.
Previous Message anj patnaik 2015-11-20 23:09:45 error messages not getting logged when running script from cron