I'm wondering what pipe slash |/ does in,

SET equal_area_radius = |/area/pi();

The statement works and it definitely changes the value:

SELECT |/125.555/pi(); --  returns: 6.32181918120139
SELECT 125.555/pi();   --  returns: 39.9653977598058

What does the pipe-slash operator |/ do?

有帮助吗?

解决方案

The |/ operator calculates the square root

postgres>  select |/16,  sqrt(16);
 ?column? | sqrt
----------+------
        4 |    4
(1 row)

So |/125.555/pi() is equivalent to sqrt(125.555/pi())

许可以下: CC-BY-SA归因
不隶属于 dba.stackexchange
scroll top