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

Bug in create operator and/or initdb

From: "John Hansen" <john(at)geeknet(dot)com(dot)au>
To: <pgsql-bugs(at)postgresql(dot)org>
Cc: "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Bug in create operator and/or initdb
Date: 2005-01-30 01:56:58
Message-ID: 5066E5A966339E42AA04BA10BA706AE56240@rodrick.geeknet.com.au (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
The following seems to me a bug in either initdb or create operator:

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.

Obviously, it should either have a corresponding function declaration, or it should be possible to create the operators using a binary compatible function (eg: where a binary compatible cast exists).

I propose, that the create operator syntax be modified to accept:

	PROCEDURE = function_name (type{,type}) 

and that checks be made for the existence of binary compatible casts between the two (four) types.

Kind Regards,

John

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2005-01-30 02:42:49
Subject: Re: Bug in create operator and/or initdb
Previous:From: Mike RylanderDate: 2005-01-30 01:48:32
Subject: Re: Implementing Bitmap Indexes

pgsql-bugs by date

Next:From: Tom LaneDate: 2005-01-30 02:42:49
Subject: Re: Bug in create operator and/or initdb
Previous:From: Tom LaneDate: 2005-01-29 23:32:13
Subject: Re: BUG #1447: Sometimes rules don't work

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