/* * lag * returns the value of VE evaluated on a row that is 1 * row before the current row within a partition, * per spec. */ Datum window_lag(PG_FUNCTION_ARGS) { return leadlag_common(fcinfo, false, false, false); }
/* * lag_with_offset * returns the value of VE evelulated on a row that is OFFSET * rows before the current row within a partition, * per spec. */ Datum window_lag_with_offset(PG_FUNCTION_ARGS) { return leadlag_common(fcinfo, false, true, false); }
/* * lead_with_offset_and_default * same as lead_with_offset but accepts default value * as its third argument. */ Datum window_lead_with_offset_and_default(PG_FUNCTION_ARGS) { return leadlag_common(fcinfo, true, true, true); }