Re: [GENERAL] How to overload POSITION

2004-11-16 Thread Troels Arvin
On Tue, 16 Nov 2004 15:56:00 -0500, Tom Lane wrote: > [... cut advice ...] Thanks. > How wedded are you to being able to say "IN"? It's only a would-be-nice-to-have. My dnaseq data type exploits the fact that DNA sequences are made from a very small alphabet (four characters), so strings can b

Re: [GENERAL] How to overload POSITION

2004-11-16 Thread Tom Lane
Troels Arvin <[EMAIL PROTECTED]> writes: > 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? Double-quote "position" in the create function command --- it's a keyword. Be aware also of the argument order gotcha.

[GENERAL] How to overload POSITION

2004-11-16 Thread Troels Arvin
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_char