problem with CREATE FUNCTION

Started by Richard Harvey Chapmanover 25 years ago4 messagesgeneral
Jump to latest
#1Richard Harvey Chapman
hchapman@3gfp.com

I'm trying to create a function for dynamically calling plsql functions,
and I can't debug it due to a problem with postgres.

My c function compiles fine.

I execute:

CREATE FUNCTION myfunc (text)
RETURNS text
AS '/myfuncs/myfunc.so'
LANGUAGE 'C';

and then a simple run of the function:

SELECT myfunc('some text');

It works.

Now, change something in the function, recompile, and postgres continues
to use the old code. I've tried dropping the function, and recreating it.
I've tried renaming the shared object file. It doesn't work. Am I
missing something?

Although, all of this wouldn't be necessary if someone would tell me how
to dynamically call functions in postgres (see my previous post regarding
"dynamic sql..."

Thanks,

R.

#2Richard Harvey Chapman
hchapman@3gfp.com
In reply to: Richard Harvey Chapman (#1)
Re: problem with CREATE FUNCTION

Update:

The problem, I think, is with psql. I never tried quitting and restarting
psql, but apparently that's required everytime you change a shared object
file.

"Urge to kill rising..."

R.

On Thu, 21 Sep 2000, Richard Harvey Chapman wrote:

Show quoted text

I'm trying to create a function for dynamically calling plsql functions,
and I can't debug it due to a problem with postgres.

My c function compiles fine.

I execute:

CREATE FUNCTION myfunc (text)
RETURNS text
AS '/myfuncs/myfunc.so'
LANGUAGE 'C';

and then a simple run of the function:

SELECT myfunc('some text');

It works.

Now, change something in the function, recompile, and postgres continues
to use the old code. I've tried dropping the function, and recreating it.
I've tried renaming the shared object file. It doesn't work. Am I
missing something?

Although, all of this wouldn't be necessary if someone would tell me how
to dynamically call functions in postgres (see my previous post regarding
"dynamic sql..."

Thanks,

R.

#3Christian Aberger
Christian.Aberger@aon.at
In reply to: Richard Harvey Chapman (#2)
RE: problem with CREATE FUNCTION

Suppose its not psql, its linux.
A shared library unloads when no more processes use it, doesn't it?

And imho this is superior to other platforms (e.g. like windose), where you
can't even link when the dll is in use.

wfR ChrisA

-----Original Message-----
From: pgsql-general-owner@hub.org [mailto:pgsql-general-owner@hub.org]On
Behalf Of Richard Harvey Chapman
Sent: Donnerstag, 21. September 2000 23:18
To: pgsql-general@postgresql.org
Subject: Re: [GENERAL] problem with CREATE FUNCTION

Update:

The problem, I think, is with psql. I never tried quitting and restarting
psql, but apparently that's required everytime you change a shared object
file.

"Urge to kill rising..."

R.

On Thu, 21 Sep 2000, Richard Harvey Chapman wrote:

Show quoted text

I'm trying to create a function for dynamically calling plsql functions,
and I can't debug it due to a problem with postgres.

My c function compiles fine.

I execute:

CREATE FUNCTION myfunc (text)
RETURNS text
AS '/myfuncs/myfunc.so'
LANGUAGE 'C';

and then a simple run of the function:

SELECT myfunc('some text');

It works.

Now, change something in the function, recompile, and postgres continues
to use the old code. I've tried dropping the function, and recreating it.
I've tried renaming the shared object file. It doesn't work. Am I
missing something?

Although, all of this wouldn't be necessary if someone would tell me how
to dynamically call functions in postgres (see my previous post regarding
"dynamic sql..."

Thanks,

R.

#4Richard Harvey Chapman
hchapman@3gfp.com
In reply to: Christian Aberger (#3)
RE: problem with CREATE FUNCTION

On Fri, 22 Sep 2000, Christian Aberger wrote:

Suppose its not psql, its linux.
A shared library unloads when no more processes use it, doesn't it?

And imho this is superior to other platforms (e.g. like windose), where you
can't even link when the dll is in use.

makes sense.

R.