postgresql/src/test/regress/expected/create_operator.out
Bruce Momjian 04a4821ade Attached is a patch implementing factorial(), returning numeric. Points
to note:

1) arttype is numeric. I thought this was the best way of allowing
arbitarily large factorials, even though factorial(2^63) is a large
number. Happy to change to integers if this is overkill.
2) since we're accepting numeric arguments, the patch tests for floats.
If a numeric is passed with non-zero decimal portion, an error is raised
since (from memory) they are undefined.

Gavin Sherry
2003-12-01 21:52:38 +00:00

32 lines
663 B
Plaintext

--
-- CREATE_OPERATOR
--
CREATE OPERATOR ## (
leftarg = path,
rightarg = path,
procedure = path_inter,
commutator = ##
);
CREATE OPERATOR <% (
leftarg = point,
rightarg = widget,
procedure = pt_in_widget,
commutator = >% ,
negator = >=%
);
CREATE OPERATOR @#@ (
rightarg = int8, -- left unary
procedure = numeric_fac
);
CREATE OPERATOR #@# (
leftarg = int8, -- right unary
procedure = numeric_fac
);
CREATE OPERATOR #%# (
leftarg = int8, -- right unary
procedure = numeric_fac
);
-- Test comments
COMMENT ON OPERATOR ###### (int4, NONE) IS 'bad right unary';
ERROR: operator does not exist: integer ######