mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-26 16:27:02 +08:00
Remove factorial operators, leaving only the factorial() function.
The "!" operator is our only built-in postfix operator. Remove it, on the way to removal of grammar support for postfix operators. There is also a "!!" prefix operator, but since it's been marked deprecated for most of its existence, we might as well remove it too. Also zap the SQL alias function numeric_fac(), which seems to have equally little reason to live. Mark Dilger, based on work by myself and Robert Haas; review by John Naylor Discussion: https://postgr.es/m/38ca86db-42ab-9b48-2902-337a0d6b8311@2ndquadrant.com
This commit is contained in:
@ -1300,12 +1300,10 @@ SELECT lcm(9999 * (10::numeric)^131068 + (10::numeric^131068 - 1), 2); -- overfl
|
||||
--
|
||||
-- Tests for factorial
|
||||
--
|
||||
SELECT 4!;
|
||||
SELECT !!3;
|
||||
SELECT factorial(4);
|
||||
SELECT factorial(15);
|
||||
SELECT 100000!;
|
||||
SELECT 0!;
|
||||
SELECT -4!;
|
||||
SELECT factorial(100000);
|
||||
SELECT factorial(0);
|
||||
SELECT factorial(-4);
|
||||
|
||||
--
|
||||
|
||||
Reference in New Issue
Block a user