Skip site navigation (1) Skip section navigation (2)

Re: Help with adding C-Language Functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Seamus Thomas Carroll <carrolls(at)cpsc(dot)ucalgary(dot)ca>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: Help with adding C-Language Functions
Date: 2005-02-10 17:31:13
Message-ID: 27779.1108056673@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-interfaces
Seamus Thomas Carroll <carrolls(at)cpsc(dot)ucalgary(dot)ca> writes:
> I changed my file from BlackboardFunctions.c to all lowercase, 
> blackboardfunctions.c, and the database now finds the add_one function.

I'm betting that the actual sequence of events was more like this:

	CREATE FUNCTION f1(...) as '/home/.../BlackboardFunctions' ...;
	[ test f1, it works, cool ]
	[ add add_one to C source file, recompile ]
	CREATE FUNCTION add_one(...) as '/home/.../BlackboardFunctions' ...;
	[ fails ]
	[ rename file ]
	CREATE FUNCTION add_one(...) as '/home/.../blackboardfunctions' ...;
	[ works ]

The reason the second try didn't work is that an existing backend will
not re-load an already loaded .so file, unless you force it to with the
LOAD command.  It doesn't notice that you've modified the file.  Had you
started a fresh session, things would have worked, too.

			regards, tom lane

In response to

Responses

pgsql-interfaces by date

Next:From: Seamus Thomas CarrollDate: 2005-02-10 19:55:44
Subject: Re: Help with adding C-Language Functions
Previous:From: Francisco Figueiredo Jr.Date: 2005-02-10 16:51:46
Subject: Re: Function return number of affected rows

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group