Skip site navigation (1) Skip section navigation (2)

Overloading '<' operator

From: trisuresh(at)yahoo(dot)co(dot)in (Suresh Tri)
To: pgsql-general(at)postgresql(dot)org
Subject: Overloading '<' operator
Date: 2004-08-31 13:18:27
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
Hi all,
 I was trying to overload '<' operator for (varchar,varchar). But  in
the function which handles the comparision I want to use the previous
'<' operator.. but it is going into a recursion.

My simplified code looks like :

create or replace function orastringcmp (varchar, varchar) returns
boolean as
        firstarg        alias for $1;
        secondarg       alias for $2;
        return firstarg < secondarg;
'language 'plpgsql';

create operator < (
        procedure = orastringcmp,
        leftarg = varchar,
        rightarg = varchar

Can any one tell how to use the previous version of ooperator while
overloading one. Are there any material online which gives the
detailed description of operator overloading? ( i could not find much
information apart from CREATE OPERATOR documentation )



pgsql-general by date

Next:From: Peter EisentrautDate: 2004-08-31 13:46:42
Subject: Re: Overloading '<' operator
Previous:From: Raymond O'DonnellDate: 2004-08-31 12:37:39
Subject: Re: European dates with Win32 version

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group