pg_orrery/src/pg_orrery.c
Ryan Malloy 3915d1784f Rename pg_orbit to pg_orrery
An existing product called PG Orbit (a mobile PostgreSQL client)
creates a naming conflict. pg_orrery — a database orrery built from
Keplerian parameters and SQL instead of brass gears.

Build system: control file, Makefile, Dockerfile, docker init script.
C source: GUC prefix, PG_FUNCTION_INFO_V1 symbol, header guards,
ereport prefixes, comments across ~30 files including vendored SGP4.
SQL: all 5 install/migration scripts, function name pg_orrery_ephemeris_info.
Tests: 9 SQL suites, 8 expected outputs, standalone DE reader test.
Documentation: CLAUDE.md, README.md, DESIGN.md, Starlight site infra,
36 MDX pages, OG renderer, logo SVG, docker-compose, agent threads.

All 13 regression suites pass. Docs site builds (37 pages).
2026-02-17 13:36:22 -07:00

34 lines
901 B
C

/*
* pg_orrery.c -- Extension entry point
*
* PostgreSQL extension for orbital mechanics.
* Provides TLE, ECI, geodetic, topocentric, observer, and pass_event types
* with SGP4/SDP4 propagation, coordinate transforms, and pass prediction.
*
* v0.3.0 adds _PG_init for GUC registration (pg_orrery.ephemeris_path)
* and on_proc_exit cleanup for the optional DE ephemeris handle.
*/
#include "postgres.h"
#include "fmgr.h"
#include "storage/ipc.h"
#include "eph_provider.h"
PG_MODULE_MAGIC;
/*
* _PG_init -- called when the extension shared library is loaded.
*
* Runs in the postmaster context. Registers GUC variables and
* the process exit cleanup callback. Does NOT open the DE file
* (that would create a shared fd inherited by all backends via
* fork with undefined stream behavior).
*/
void
_PG_init(void)
{
eph_register_gucs();
on_proc_exit(eph_cleanup, (Datum) 0);
}