Thread: Dependence beetwen Function

Dependence beetwen Function

From
"Gaetano Mendola"
Date:
Hi to all

Suppose that I have the function A that use the fucntion B.
When I drop and reconstruct B I should also reconstruct A.
Can I avoid this ?
Is a really problem with hundreds of function around.


Ciao
Gaetano

--
#exclude <windows>
#include <CSRSS>
printf("\t\t\b\b\b\b\b\b");.
printf("\t\t\b\b\b\b\b\b");


Re: Dependence beetwen Function

From
Stephan Szabo
Date:
On Tue, 12 Mar 2002, Gaetano Mendola wrote:

> Hi to all
>
> Suppose that I have the function A that use the fucntion B.
> When I drop and reconstruct B I should also reconstruct A.
> Can I avoid this ?
> Is a really problem with hundreds of function around.

If you're using 7.2 you can use create or replace function
rather than drop function followed by create function.



Re: Dependence beetwen Function

From
"Dan Langille"
Date:
On 12 Mar 2002 at 9:18, Stephan Szabo wrote:

>
> On Tue, 12 Mar 2002, Gaetano Mendola wrote:
>
> > Hi to all
> >
> > Suppose that I have the function A that use the fucntion B.
> > When I drop and reconstruct B I should also reconstruct A.
> > Can I avoid this ?
> > Is a really problem with hundreds of function around.
>
> If you're using 7.2 you can use create or replace function
> rather than drop function followed by create function.

I just finished updating my SP and RI functions to take advantage of this.
 While doing that I starting thinking about triggers.  Checking the
documentation, I don't see a similar feature for triggers.  I'm guessing
that triggers do not suffer from the same problem as that which prompted
the original post.

--
Dan Langille
The FreeBSD Diary - http://freebsddiary.org/ - practical examples


Re: Dependence beetwen Function

From
Stephan Szabo
Date:
On Tue, 12 Mar 2002, Dan Langille wrote:

> On 12 Mar 2002 at 9:18, Stephan Szabo wrote:
>
> >
> > On Tue, 12 Mar 2002, Gaetano Mendola wrote:
> >
> > > Hi to all
> > >
> > > Suppose that I have the function A that use the fucntion B.
> > > When I drop and reconstruct B I should also reconstruct A.
> > > Can I avoid this ?
> > > Is a really problem with hundreds of function around.
> >
> > If you're using 7.2 you can use create or replace function
> > rather than drop function followed by create function.
>
> I just finished updating my SP and RI functions to take advantage of this.
>  While doing that I starting thinking about triggers.  Checking the
> documentation, I don't see a similar feature for triggers.  I'm guessing
> that triggers do not suffer from the same problem as that which prompted
> the original post.

I don't know of anything that directly refers to triggers.
You will however want to use create or replace function on the functions
refered to by triggers since that way you don't need to drop and recreate
the trigger.


Re: Dependence beetwen Function

From
"Gaetano Mendola"
Date:
"Stephan Szabo" <sszabo@megazone23.bigpanda.com> wrote:
> On Tue, 12 Mar 2002, Gaetano Mendola wrote:
>
> > Hi to all
> >
> > Suppose that I have the function A that use the fucntion B.
> > When I drop and reconstruct B I should also reconstruct A.
> > Can I avoid this ?
> > Is a really problem with hundreds of function around.
>
> If you're using 7.2 you can use create or replace function
> rather than drop function followed by create function.
>
Fine. Yesterday with the release 7.1.3 I notice that if a table have a
constraint like this:


CREATE TABLE user_data (
.......
login VARCHAR(64) NOT NULL CHECK ( myFunction(login) ),
......
);

if I drop and recreate the function myFunction
I'm not able to insert data on table user_data.
May be with the version 7.2 this problem not exist anymore
(with the replace feature) but I notice also that if I do a

pg_dump > dump.sql

I have on dump.sql before the creation of tables and after the
creation of functions, in this way the table user_data is not
created ... :-(



I hope that this was fixed in version 7.2

Ciao
Gaetano

--
#exclude <windows>
#include <CSRSS>
printf("\t\t\b\b\b\b\b\b");.
printf("\t\t\b\b\b\b\b\b");




Re: Dependence beetwen Function

From
Jean-Michel POURE
Date:
Le Mardi 12 Mars 2002 17:23, Gaetano Mendola a écrit :
> Hi to all
> Suppose that I have the function A that use the fucntion B.
> When I drop and reconstruct B I should also reconstruct A.
> Can I avoid this ?
> Is a really problem with hundreds of function around.
> Ciao
> Gaetano

Dear Gaetano,

pgAdmin2 (http://www.pgadmin.org) support CREATE OR REPLACE FUNCTION. Also,
the CVS latest version offers pseudo modification of views and triggers
(binaries available in CVS).

Regards, Jean-Michel POURE

Re: Dependence beetwen Function

From
Jean-Michel POURE
Date:
Le Mercredi 13 Mars 2002 16:11, Gaetano Mendola a écrit :
> But of course I should use it with the version 7.2 for use this feature.
> Or not ?
Yes, CREATE OR REPLACE FUNCTION is only available from PostgreSQL 7.2+.

Re: Dependence beetwen Function

From
"Gaetano Mendola"
Date:
"Jean-Michel POURE" <jm.poure@freesurf.fr>> Dear Gaetano,
>
> pgAdmin2 (http://www.pgadmin.org) support CREATE OR REPLACE FUNCTION.
Also,
> the CVS latest version offers pseudo modification of views and triggers
> (binaries available in CVS).


But of course I should use it with the version 7.2 for use this feature.
Or not ?



Ciao
Gaetano

--
#exclude <windows>
#include <CSRSS>
printf("\t\t\b\b\b\b\b\b");.
printf("\t\t\b\b\b\b\b\b");