Ваша проблема может быть где-то еще. Ваша геометрия кажется верной:
WITH values(location, userid) AS
(VALUES ('0101000000000000C04141464000000000FE174440',5),
('0101000000000000200A45464000000000D7174440',16))
SELECT ST_Distance(location::GEOMETRY,ST_GeomFromText('POINT(44 45)')) FROM values;
st_distance
------------------
4.83948955585514
4.84387473202619
(2 Zeilen)
Вот несколько примеров различных типов литералов геометрии:
ST_GeomFromText
db=# SELECT ST_GeomFromText('POINT(1 2)');
st_geomfromtext
--------------------------------------------
0101000000000000000000F03F0000000000000040
(1 Zeile)
ST_GeomFromGeoJSON
:
db=# SELECT ST_GeomFromGeoJSON('{"type":"Point","coordinates":[1,2]}');
st_geomfromgeojson
--------------------------------------------
0101000000000000000000F03F0000000000000040
(1 Zeile)
ST_GeomFromEWKT
db=# SELECT ST_GeomFromEWKT('SRID=4269;POINT(1 2)');
st_geomfromewkt
----------------------------------------------------
0101000020AD100000000000000000F03F0000000000000040
(1 Zeile)
ST_GeomFromGML
db=# SELECT ST_GeomFromGML('<gml:Point><gml:coordinates>1,2</gml:coordinates></gml:Point>');
st_geomfromgml
--------------------------------------------
0101000000000000000000F03F0000000000000040
(1 Zeile)
ST_GeomFromKML
db=# SELECT ST_GeomFromKML('<Point><coordinates>1,2</coordinates></Point>');
st_geomfromkml
----------------------------------------------------
0101000020E6100000000000000000F03F0000000000000040
(1 Zeile)