TO_NUMBER supports Roman numeral conversion via the RN pattern (PostgreSQL 18+).
ERROR_ON_NULL returns its argument unchanged, or fails the query with null value not allowed when the argument is NULL, so a missing value stops the query instead of reaching your code. Like any polymorphic function, it cannot take a bare string literal: pass a field, an expression over one, or a numeric literal.
DISTANCE is the earthdistancepoint <@> point operator. It returns the great-circle distance in statute miles between two point values written as (longitude, latitude). It is not a PostGIS operator and does not accept geometry or geography values.
Requires the earthdistance extension:CREATE EXTENSION IF NOT EXISTS earthdistance CASCADE; - earthdistance depends on cube, which CASCADE installs.