Function validateSegment

Checks a segment name and returns it.

A segment name is lower-case letters, digits and underscores, starts with a letter or an underscore, and has at most 63 characters: an unquoted PostgreSQL identifier, and a safe file, IndexedDB and Capacitor database name. It is not public, information_schema or a name beginning with pg_, which PostgreSQL keeps for its own schemas.

When the name is not one a segment can take.