![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
CREATE FUNCTION my_func (inet, inet) as '$libdir/my_func.so' LANGUAGE 'C' IMMUTABLE STRICT; CREATE OPERATOR <<< ( PROCEDURE = my_func, LEFTARG = cidr, RIGHTARG = cidr, RESTRICT = contsel, JOIN = contjoinsel ); ERROR: function my_func(cidr, cidr) does not exist |
|
Now, if you look at the catalog, and the < (less than operator) as an example you will see that: Two operators are defined for < - one for inet,inet and another for cidr,cidr. Only one function exists named network_lt, and is declared as taking (inet,inet) as arguments. |
#2
| |||
| |||
|
|
My opinion is that this is a very bogus shortcut in the=20 network datatype code. There are no cases outside the=20 inet/cidr group where an operator doesn't exactly match its=20 underlying function. (The whole business of inet and cidr=20 being almost but not quite the same type is maldesigned anyway...) =20 The right solution for you is to declare two SQL functions.=20=20 Whether you make them point at the same underlying C code is=20 up to you. |
#3
| |||
| |||
|
|
In that case may I suggest fixing the catalog so network_* functions exists for both datatypes! |
![]() |
| Thread Tools | |
| Display Modes | |
| |