Re: [HACKERS] contrib Makefiles

2002-08-15 Thread Bruce Momjian


Yes, you can optionally specify the symbol to find in the *.so file as
part of the CREATE FUNCTION command.

---

Tom Lane wrote:
> "Christopher Kings-Lynne" <[EMAIL PROTECTED]> writes:
> > I guess my question would be that currently fulltextindex generates SQL like
> > this:
> 
> > create function fti() returns opaque as
> > '$libdir/fti'
> > language 'C';
> 
> > So it references the fti.so, but where does it say what function to actually
> > run in fti.so?  Or is it assumed in C functions that the function to call in
> > the shared object is the same as the name of the function???
> 
> That's the assumption unless you specify differently.  Time to reread
> the CREATE FUNCTION man page ...
> 
>   regards, tom lane
> 
> ---(end of broadcast)---
> TIP 4: Don't 'kill -9' the postmaster
> 

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



Re: [HACKERS] contrib Makefiles

2002-08-14 Thread Tom Lane

"Christopher Kings-Lynne" <[EMAIL PROTECTED]> writes:
> I guess my question would be that currently fulltextindex generates SQL like
> this:

> create function fti() returns opaque as
> '$libdir/fti'
> language 'C';

> So it references the fti.so, but where does it say what function to actually
> run in fti.so?  Or is it assumed in C functions that the function to call in
> the shared object is the same as the name of the function???

That's the assumption unless you specify differently.  Time to reread
the CREATE FUNCTION man page ...

regards, tom lane

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



Re: [HACKERS] contrib Makefiles

2002-08-14 Thread Joe Conway

Christopher Kings-Lynne wrote:
> create function fti() returns opaque as
> '$libdir/fti'
> language 'C';
> 
> So it references the fti.so, but where does it say what function to actually
> run in fti.so?  Or is it assumed in C functions that the function to call in
> the shared object is the same as the name of the function???
> 

It does if you're not specific. Take a look at dblink.sql.in. All of the 
dblink functions are in one shared object file.

e.g.
CREATE OR REPLACE FUNCTION dblink (text,text) RETURNS setof int
   AS 'MODULE_PATHNAME','dblink' LANGUAGE 'c'
   WITH (isstrict);

CREATE OR REPLACE FUNCTION dblink_tok (int,int) RETURNS text
   AS 'MODULE_PATHNAME','dblink_tok' LANGUAGE 'c'
   WITH (isstrict);
...
etc.

Joe


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



Re: [HACKERS] contrib Makefiles

2002-08-14 Thread Christopher Kings-Lynne

> "Christopher Kings-Lynne" <[EMAIL PROTECTED]> writes:
> > Is it possible to have two different functions in the .so that
> can be made
> > into two different postgres funtions, both referencing the same .so?
>
> Certainly, what's the problem there?  Offhand I can't think of any
> contrib modules that only define one function...

OK then,

I guess my question would be that currently fulltextindex generates SQL like
this:

create function fti() returns opaque as
'$libdir/fti'
language 'C';

So it references the fti.so, but where does it say what function to actually
run in fti.so?  Or is it assumed in C functions that the function to call in
the shared object is the same as the name of the function???

Chris


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



Re: [HACKERS] contrib Makefiles

2002-08-14 Thread Tom Lane

"Christopher Kings-Lynne" <[EMAIL PROTECTED]> writes:
> Is it possible to have two different functions in the .so that can be made
> into two different postgres funtions, both referencing the same .so?

Certainly, what's the problem there?  Offhand I can't think of any
contrib modules that only define one function...

regards, tom lane

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



Re: [HACKERS] contrib Makefiles

2002-08-14 Thread Christopher Kings-Lynne

Is it possible to have two different functions in the .so that can be made
into two different postgres funtions, both referencing the same .so?

Chris

> -Original Message-
> From: Peter Eisentraut [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, 15 August 2002 6:02 AM
> To: Christopher Kings-Lynne
> Cc: Hackers
> Subject: Re: [HACKERS] contrib Makefiles
>
>
> Christopher Kings-Lynne writes:
>
> > How can I modify it to build two different C files into two
> different .so's?
>
> That is next to impossible in the current setup.
>
> --
> Peter Eisentraut   [EMAIL PROTECTED]
>


---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://archives.postgresql.org



Re: [HACKERS] contrib Makefiles

2002-08-14 Thread Peter Eisentraut

Christopher Kings-Lynne writes:

> How can I modify it to build two different C files into two different .so's?

That is next to impossible in the current setup.

-- 
Peter Eisentraut   [EMAIL PROTECTED]


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]