I have a table with a point data type that stores the latitude and longitude. I plan to insert from a function, and the input argument is defined as a float(18) [which is where I suspect the problem comes from].
Let's say the following values are used:
48.277274, -116.5547745
If I insert these with from the command line the database shows those values. But if I insert them from the function the values in the database are:
48.2772750854492, -116.55477142334
I'm not doing anything to modify the values, as I mention above I believe bringing them in as float is causing the problem, but I've tried various other types and only get other issues.
Would greatly appreciate any help.
CREATE OR REPLACE FUNCTION myfun(
float(18), -- lat
float(18)) -- lon
RETURNS integer AS
$BODY$
DECLARE
postcnt integer;
BEGIN
INSERT INTO user(usergeo)
VALUES (point($1,$2))
RETURN 1;
END
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
numeric?