Thread: Concurrent modification of plpgsql function body

Concurrent modification of plpgsql function body

From
Alex Vinogradovs
Date:
Hello all,


I've got an application that keeps a persistent connection into the
database and constantly executes number of stored functions. Sometimes
I need to modify the implementation of those functions to change the
data layout, but doing that results in errors like this:

unrecognized node type: 1852387187

Is it allowed to modify those functions from other connections ?

Thanks!

Best regards,
Alex Vinogradovs

Re: Concurrent modification of plpgsql function body

From
Tom Lane
Date:
Alex Vinogradovs <AVinogradovs@Clearpathnet.com> writes:
> I've got an application that keeps a persistent connection into the
> database and constantly executes number of stored functions. Sometimes
> I need to modify the implementation of those functions to change the
> data layout, but doing that results in errors like this:

> unrecognized node type: 1852387187

This report is far too vague to give a useful reply to.
What exactly do you mean by "modify the implementation"?

            regards, tom lane

Re: Concurrent modification of plpgsql function body

From
Alex Vinogradovs
Date:
I mean I re-create the function with the same signature but
different body, and when the application invokes that function
again, it starts getting those errors.


Alex.


On Fri, 2008-01-04 at 15:36 -0500, Tom Lane wrote:
> Alex Vinogradovs <AVinogradovs@Clearpathnet.com> writes:
> > I've got an application that keeps a persistent connection into the
> > database and constantly executes number of stored functions. Sometimes
> > I need to modify the implementation of those functions to change the
> > data layout, but doing that results in errors like this:
>
> > unrecognized node type: 1852387187
>
> This report is far too vague to give a useful reply to.
> What exactly do you mean by "modify the implementation"?
>
>             regards, tom lane

Re: Concurrent modification of plpgsql function body

From
Alvaro Herrera
Date:
Alex Vinogradovs wrote:
> I mean I re-create the function with the same signature but
> different body, and when the application invokes that function
> again, it starts getting those errors.

Are you using CREATE OR REPLACE FUNCTION, or DROP FUNCTION followed by
CREATE FUNCTION?



--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

Re: Concurrent modification of plpgsql function body

From
Alex Vinogradovs
Date:
Yes, I'm using CREATE OR REPLACE.

Alex.


On Mon, 2008-01-07 at 16:17 -0300, Alvaro Herrera wrote:
> Alex Vinogradovs wrote:
> > I mean I re-create the function with the same signature but
> > different body, and when the application invokes that function
> > again, it starts getting those errors.
>
> Are you using CREATE OR REPLACE FUNCTION, or DROP FUNCTION followed by
> CREATE FUNCTION?
>
>
>

Re: Concurrent modification of plpgsql function body

From
Tom Lane
Date:
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Alex Vinogradovs wrote:
>> I mean I re-create the function with the same signature but
>> different body, and when the application invokes that function
>> again, it starts getting those errors.

> Are you using CREATE OR REPLACE FUNCTION, or DROP FUNCTION followed by
> CREATE FUNCTION?

Perhaps more to the point, we need to see a complete example.  I don't
see how either way of changing a plpgsql function would result in the
described error.

            regards, tom lane