Re: Function to blame? - Mailing list pgsql-novice

From Tom Lane
Subject Re: Function to blame?
Date
Msg-id 9812.1107232381@sss.pgh.pa.us
Whole thread Raw
In response to Function to blame?  (Michael Guerin <guerin@rentec.com>)
Responses Re: Function to blame?  (Michael Guerin <guerin@rentec.com>)
List pgsql-novice
Michael Guerin <guerin@rentec.com> writes:
>   I'm trying to resolve an issue with the database crashing when under a
> heavy load.  The error is hard to reproduce and happens once or twice a
> month.  It's also been happening since Postgresql v7 and just happened
> again on v8.   The database always crashes in the same way and always
> involves the function below.   The log starts to fill with these messages:

Hmm, I suppose these messages are coming from several different
backends?  It would be useful to adjust your logging configuration so
we can tell which messages are coming from which sessions.  (See
log_pid or log_line_prefix depending on PG version.)

My first guess is that something is getting confused about which
temporary-table schema belongs to which backend, but it's hard to see
how ... and some attempts at creating a race condition during backend
entry/exit didn't show a problem, so that theory could be all wet.

It'd be helpful if you could develop a self-contained test case (even
one that takes a lot of repetitions to hit the error).

>  I've included the schema for the table involved and the function code
> to see if I'm doing something in the function that I ought to do
> better.

You should be thinking in terms of how to make the error reproducible,
not how to avoid it ;-).  This is surely a backend bug of some sort.

            regards, tom lane

pgsql-novice by date:

Previous
From: James DeMond
Date:
Subject: Arrays of user-defined data types in other user-defined data types
Next
From: Tom Lane
Date:
Subject: Re: Arrays of user-defined data types in other user-defined data types