pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Seamus Thomas Carroll <carrolls@cpsc.ucalgary.ca>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: Help with adding C-Language Functions
Date: Thu, 10 Feb 2005 12:55:44 -0700 (MST)
Message-ID: <Pine.LNX.4.60.0502101251550.5503@frost> (raw)
In-Reply-To: <27779.1108056673@sss.pgh.pa.us>
References: <Pine.LNX.4.60.0502091954340.5503@frost>
	<Pine.LNX.4.60.0502100114310.5503@frost>
	<27779.1108056673@sss.pgh.pa.us>

Thinking back I think i tried g++ first which caused the error to occur. 
When i then tried cc the .so was already loaded.

I have c++ classes i want to use but when i complile using g++ i get the 
error (cant find function x in file.so).  Does anyone have experience 
compiling c++ and loading the function?

Seamus

On Thu, 10 Feb 2005, Tom Lane wrote:

> Seamus Thomas Carroll <carrolls@cpsc.ucalgary.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
>



view thread (8+ messages)  latest in thread

Message-ID: <Pine.LNX.4.60.0502101251550.5503@frost>
Permalink:  ../Pine.LNX.4.60.0502101251550.5503@frost/
Also on:    postgresql.org/message-id/Pine.LNX.4.60.0502101251550.5503@frost

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: carrolls@cpsc.ucalgary.ca, tgl@sss.pgh.pa.us
  Subject: Re: Help with adding C-Language Functions
  In-Reply-To: <Pine.LNX.4.60.0502101251550.5503@frost>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox