There's a section of the Penal Code in California, 849(b)(2), where someone arrested for drunk and disorderly (Which is Penal Code section 647(f).) is basically kept in custody until sober then released. Under that section, the arrest becomes a detention.