A fence on a retaining wall can trigger more than one rule
Once a fence sits on top of, beside or immediately behind a retaining wall, the project is no longer just a simple fence-height question. Municipalities may regulate the retaining wall separately, use a special method for measuring fence height from grade, or require structural approval for the wall.
Grade changes can change the measured height
Do not assume the fence is measured only from the top of the retaining wall. Local bylaws can specify where grade is taken and whether the wall and fence are considered together for zoning or safety purposes. Sloping lots make this especially important.
Calgary shows why the wall needs its own check
Calgary's current fence and retaining-wall guidance says retaining walls 1.2 m or higher require a development permit and explains that retaining-wall and fence heights are measured from grade. That is separate from the ordinary front-yard, rear-yard and corner-visibility fence limits.
See the City of Calgary fences and retaining walls guidance.
A guard can be different from a fence
Where a drop creates a fall hazard, building-code guard requirements may apply independently from a zoning fence limit. That can affect height, openings and structural design. Ask the municipality whether the upper barrier is being treated as a fence, a guard, or both.
Plan the wall and fence together
Before construction, show the existing grade, proposed finished grade, wall height, fence height and distance to property lines on the same drawing. It is much easier to resolve the rule before the wall establishes the final elevation.