.Decks and above ground pool barriers is one of the hardest things I have to explain to people...
I agree, especially since the code acts like barriers are only ever built on grade and not on decks, landings or stairways. I would allow a 4" opening under the railing per #4. But the barrier needs to continue under the deck too down to within 2" of the ground.
305.2.1 Barrier Height and Clearances
Barrier heights and clearances shall be in accordance with all of the following:
1. The top of the barrier shall be not less than 48 inches (1219 mm) above grade where measured on the side of the barrier that faces away from the pool or spa. Such height shall exist around the entire perimeter of the barrier and for a distance of 3 feet (914 mm) measured horizontally from the outside of the required barrier.
2. The vertical clearance between grade and the bottom of the barrier shall not exceed 2 inches (51 mm) for grade surfaces that are not solid, such as grass or gravel, where measured on the side of the barrier that faces away from the pool or spa.
3. The vertical clearance between a surface below the barrier to a solid surface, such as concrete, and the bottom of the required barrier shall not exceed 4 inches (102 mm) where measured on the side of the required barrier that faces away from the pool or spa.
4. Where the top of the pool or spa structure is above grade, the barrier shall be installed on grade or shall be mounted on top of the pool or spa structure. Where the barrier is mounted on the top of the pool or spa, the vertical clearance between the top of the pool or spa and the bottom of the barrier shall not exceed 4 inches (102 mm).