Re: [PATCHES] Changes in /contrib/fulltextindex

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Florian Helmberger <f(dot)helmberger(at)uptime(dot)at>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] Changes in /contrib/fulltextindex
Date: 2002-07-12 03:40:42
Message-ID: 200207120340.g6C3egC10151@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Christopher Kings-Lynne wrote:
> > Christopher Kings-Lynne wrote:
> > > Yeah, I've got it Bruce - I still haven't had time to look into it and I
> > > really don't know what to do about the backward compatibility
> > issue. How do
> > > I set up 2 identically named C functions with different parameter lists?
> >
> > Oh, that is easy. When you CREATE FUNCTION, you just specify the
> > different params. However, if you are calling it _from_ C, then it is
> > impossible. Just break backward compatibility, I think was Tom's
> > suggestion, and I agree.
>
> I mean, can I code up 2 functions called "fti" and put them both in the
> fti.c and then have them both in the fti.so? Then when CREATE FUNCTION is
> run it will link to the correct function in the fti.so depending on the
> parameter list?

Call them different C names, but name them the same in CREATE FUNCTION
funcname. Just use a different symbol name here:

CREATE [ OR REPLACE ] FUNCTION name ( [ argtype [, ...] ] )
^^^^ same here
RETURNS rettype
AS 'obj_file', 'link_symbol'
^^^^^^^^^^^^^ different here
LANGUAGE langname
[ WITH ( attribute [, ...] ) ]

Does that help?

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2002-07-12 03:41:35 Re: [PATCHES] Changes in /contrib/fulltextindex
Previous Message Christopher Kings-Lynne 2002-07-12 03:38:20 Re: [PATCHES] Changes in /contrib/fulltextindex