quoteAsPgIdentifier

Escapes a PostgreSQL identifier (e.g. table name, type name, channel name) by wrapping it in double quotes and escaping any internal double quotes if it contains special characters.

Also performs validation to ensure the identifier does not contain the NUL (\0) character, which is invalid in PostgreSQL identifiers and will throw a BadStatementException if found.