How to overload POSITION - Mailing list pgsql-general

From Troels Arvin
Subject How to overload POSITION
Date
Msg-id pan.2004.11.16.20.33.28.205138@arvin.dk
Whole thread Raw
Responses Re: How to overload POSITION
List pgsql-general
Hello,

I'm working on a datatype which I call dnaseq. The basic stuff like
input/output functions, comparison operators, etc., work well.

I have overloaded the CHARACTER_LENGTH function without problems:

CREATE OR REPLACE FUNCTION character_length(dnaseq)
RETURNS integer
AS 'dnaseq','dnaseq_charlen'
LANGUAGE 'C' IMMUTABLE STRICT;

Now, I want to overload the POSITION(lftval IN rgtval) function, but how
do I do that? I've tried

CREATE OR REPLACE FUNCTION position(dnaseq,dnaseq)
RETURNS integer
AS 'dnaseq'
LANGUAGE 'C' IMMUTABLE STRICT;

But now I get:
ERROR:  syntax error at or near "(" at character 36
LINE 1: CREATE OR REPLACE FUNCTION position(dnaseq,dnaseq)

I assume this is because the POSITION function uses "IN" to separate
arguments, in stead of a comma. Is there a way to overload it?

--
Greetings from Troels Arvin, Copenhagen, Denmark


pgsql-general by date:

Previous
From: "Sim Zacks"
Date:
Subject: Re: I'm about to release the next postgresql RFD.
Next
From: Bernd Helmle
Date:
Subject: Re: Fwd: Problem installing Postgresql on MDK10.0