Skip to content
PostgreSQL elephant orbiting a planet

pg_orrery Documentation

It's not rocket science. (It's celestial mechanics. But now it's just SQL.)

Track anything in orbit

SGP4/SDP4 propagation over 12,000 TLEs in 17ms. GiST-indexed conjunction screening. Pass prediction with AOS/TCA/LOS. Ground tracks, subsatellite points, and topocentric observation — all as SQL functions.

Observe the solar system

Eight planets via VSOP87 (built-in) or optional JPL DE440/441 (~0.1 milliarcsecond). The Sun, the Moon via ELP2000-82B, 19 planetary moons across Jupiter, Saturn, Uranus, and Mars. Stars from J2000 catalog coordinates. Comets and asteroids from Keplerian elements.

Predict radio bursts

Jupiter-Io decametric emission probability from Carr source regions. Io orbital phase, Jupiter Central Meridian Longitude (System III), and burst probability — batch-computed over any time range with generate_series.

Plan trajectories

Lambert solver for interplanetary transfers between any two planets. Pork chop plots as SQL CROSS JOINs — 22,500 transfer solutions in 8.3 seconds. Departure C3, arrival C3, time of flight, transfer SMA.