age_range

5 rows


Description

Guest-age bands for the age_range report segment. Must be a gap-free, non-overlapping partition with exactly one open-ended top band; maintained through rpc.masterfile_age_range_get / _save. Ages outside every band (and NULL guest_age) are folded into the reports’ id = 999999 / ‘Others/Unknown’ row.

Columns

Column Type Size Nulls Auto Default Children Parents Comments
from_age int4 10 null

Inclusive lower bound, and the id the insight reports emit for this band. May be negative or zero; the lowest band must start at 0 or below so that no age is left uncategorised.

to_age int4 10 √ null

Inclusive upper bound. NULL means open-ended: exactly one band (the highest) may be open-ended.

label text 2147483647 null

Display name of the band, returned by fn_age_range(). Must be unique. The values ‘others’, ‘other’ and ‘unknown’ are reserved: sp_rsv_pickup_stat and friends fold any band with such a label into the Others/Unknown bucket, so the band would silently disappear from the report.

seq int4 10 0

Unused. The insight reports order these segments by id (i.e. from_age), so this column has no effect; retained for backward compatibility and deliberately left out of the RPC contract.

Indexes

Constraint Name Type Sort Column(s)
pk_age_range Primary key Asc from_age

Check Constraints

Constraint Name Constraint
chk_age_range_bounds ((to_age IS NULL) OR (to_age >= from_age))

Relationships