Inspired by Postgres: The Bits You Haven't Found:
\set n 1000;
SELECT 4*COUNT(DISTINCT(x, y))/(1.0*:n*:n) AS result FROM generate_series(0,:n) AS x, generate_series(0,:n) AS y WHERE x*x + y*y <= :n*:n;
This uses the simple method of checking every integer-valued point in [0,n] x [0,n]
to see if it's inside the circle - the Wikipedia approximations to pi article has more details.