PI
Returns the value of π.
PostgreSQL 17.5
PI()Return value
The number π (double precision): 3.141592653589793
Examples
Value of π
PostgreSQL 17.5
SELECT PI();Circle area and degrees
PostgreSQL 17.5
SELECT ROUND((PI() * POWER(3, 2))::numeric, 2) AS circle_area,
DEGREES(PI()) AS degrees;Details
To convert angles, use DEGREES (radians to degrees) and RADIANS (degrees to radians): DEGREES(PI()) = 180.