Re: replace function, what happens afterwards?

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: MirrorX <mirrorx(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: replace function, what happens afterwards?
Date: 2014-04-16 13:06:20
Message-ID: 534E804C.1030107@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 16/04/2014 13:54, MirrorX wrote:
> dear all,
>
> i have a question regarding a recent problem that we faced and we are
> trying to identify. let's suppose we have a function A and a function
> B that in some point calls function A.
>
> function A-> ….. insert into table1(col1,col2) values ($1,$2) …..
>
>
> function B -> … select… update…. insert…. select.. A(); ….
>
>
>
> Now function A is changed a bit, i.e we add a new argument in the
> insert statement that it has (a constant). However this does not
> affect neither the arguments of the function, nor the return type.
> And then function A is being recompiled (with 'create or replace').
>
> Afterwards, will function B keep working? Or we need to recomplie
> function B as well (even if the code won't change)?

No, you don't need to re-create function B - it should keep working fine.

As far as I know, functions aren't "compiled", at least at the point
when you execute CREATE FUNCTION anyway - the text representation of the
code is stored, and then loaded when the function is invoked. I could be
wrong about this - others will know better.

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Fede Martinez 2014-04-16 13:07:34 Re: Querying all documents for a company and its projects etc
Previous Message MirrorX 2014-04-16 12:54:31 replace function, what happens afterwards?