plans pg null ref