Pool codes are created by the state. It’s up to the City or County to enforce the codes. For the fencing side of things, the laws are written slightly different for the type of fence constructed. The main factors pertaining to all styles is height, size of openings, and gates.
On our website is a PDF (Medford-Swimming-Pools-Guidelines) that you can print out, but here is a brief overview. The minimum height in the state of Oregon is 4’ high. Gates have to open out with self-closing and latching hardware. The release mechanism needs to be at least 54” above grade.
Chain link requirements are 1 ¼” openings or 2” mesh with the vinyl slats installed.
Iron and vinyl requirements are the same: 4” openings are a max, as long as there is sufficient space between the horizontals. If the rail spacing is not sufficient, then the vertical picket spacing needs to be 1 ¾”.
There are many wood varieties, so refer to the code for your specific style, but standard is the finish side should face out away from the pool. If the pickets aren’t touching, then 1¾” is the max gap.
The idea behind all of these is to deter a child from climbing over the fence.
Other factors the inspectors will look at are pool covers, auto closing doors, alarms on doors, and proper latching. However, these do not allow for no fencing at all. They are looking for a barrier between your door to the pool and the pool itself.