fix: add round(double precision, integer) overload so ad-hoc queries work without ::numeric casts
This commit is contained in:
@@ -0,0 +1,8 @@
|
|||||||
|
-- Add a round(double precision, integer) overload so ad-hoc queries
|
||||||
|
-- using round(some_float, 2) work without explicit ::numeric casts.
|
||||||
|
-- PostgreSQL only provides round(numeric, integer) out of the box.
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION round(double precision, integer)
|
||||||
|
RETURNS numeric AS $$
|
||||||
|
SELECT round($1::numeric, $2);
|
||||||
|
$$ LANGUAGE sql IMMUTABLE STRICT;
|
||||||
Reference in New Issue
Block a user