How to overload POSITION

From: Troels Arvin <troels(at)arvin(dot)dk>
To: pgsql-general(at)postgresql(dot)org
Subject: How to overload POSITION
Date: 2004-11-16 20:33:28
Message-ID: pan.2004.11.16.20.33.28.205138@arvin.dk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bernd Helmle 2004-11-16 20:43:24 Re: Fwd: Problem installing Postgresql on MDK10.0
Previous Message Michael Fuhr 2004-11-16 20:11:12 Re: question about temp table in function