Re: insertion with trigger failed unexpectedly

From: Richard Huxton <dev(at)archonet(dot)com>
To: Anton(dot)Nikiforov(at)loteco(dot)ru, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: insertion with trigger failed unexpectedly
Date: 2004-01-13 11:26:12
Message-ID: 200401131126.12086.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tuesday 13 January 2004 10:36, Anton(dot)Nikiforov(at)loteco(dot)ru wrote:
> Hello Tom,
> Here is a function code (i changed only my real IPs, just in case) :)
> They were in place of 10.0.0.0/24 networks, all the rest including
> 192.168.0/16 is true values.
> I have checked alot of times and looks like testing and live
> environment are the same, the only thing that differ that insertion
> tool (that is getting plain values from stdin and inserting them into
> the table) is being run from cron daemon.
> All the rest is the same.
> Update Failed error happening not in exacxt time, but randomly.
> Currently i removed a trigger from the table definition and all
> records being inserted just fine with no looses.
> The additional problem is that the TRIGGER defined as AFTER INSERT
> that means that the record should appear in the raw table anyway, but
> it is not happened.

So - the error is that occasionally, some values aren't entered in the raw
table nor summarised in the daily table?

Does your live insertion code check the result-code from PG? If the insert is
failing, it should say so.

I'd suspect some concurrency issues, but I can't see anything obvious. Testing
for this is a pain, but it produces exactly these kind of problems. Try
running 5 test processes at once, all inserting simultaneously and see if
that reproduces your problem.

If no-one else has a bright idea, I'll try running it with some test data on
my end this afternoon (London time) if I get a chance.

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2004-01-13 11:28:09 Re: qq- repost
Previous Message Anton.Nikiforov 2004-01-13 10:36:20 Re: insertion with trigger failed unexpectedly