This requirement sounds a bit unreasonable, just imagine all the tourists who spend time on the beach - I hardly think it's common that all those people on the beach will have a passport on them. Especially the part where they say "they can detain you". Perhaps authorities can order you to present valid documentation (if needed in some situations) in 24h at the local police station - that's more realistic.