OtterMind/Chat2DB · error · IllegalArgumentException

Invalid PostgreSQL bit literal: ${value}

Error message

Invalid PostgreSQL bit literal: ${value}

What it means

Error "Invalid PostgreSQL bit literal: ${value}" thrown in OtterMind/Chat2DB.

Source

Thrown at chat2db-community-server/chat2db-community-plugins/chat2db-community-postgresql/src/main/java/ai/chat2db/plugin/postgresql/PostgreSqlGuards.java:173

            throw invalid("privilege", value);
        }
        return privilege;
    }

    public static String requireViewStorageClause(String value) {
        String storageClause = StringUtils.normalizeSpace(value).toUpperCase(Locale.ROOT);
        if (!VIEW_STORAGE_CLAUSES.contains(storageClause)) {
            throw invalid("view storage clause", value);
        }
        return storageClause;
    }

    /**
     * Validate content of a B'...' bit literal.
     */
    public static String requireBitLiteral(String value) {
        if (value == null || !BIT_LITERAL_PATTERN.matcher(value).matches()) {
            throw new IllegalArgumentException("Invalid PostgreSQL bit literal: " + value);
        }
        return value;
    }

    /**
     * Validate content of a \x... bytea hex literal.
     */
    public static String requireHexLiteral(String value) {
        if (value == null || !HEX_LITERAL_PATTERN.matcher(value).matches()) {
            throw new IllegalArgumentException("Invalid PostgreSQL bytea hex literal: " + value);
        }
        return value;
    }

    /**
     * Validate an option that must be one of the given enum constants (e.g. view check option).
     * Returns the canonical enum name.
     */

View on GitHub (pinned to 5ee1e990e7)

Solutions

  1. Use only 0 and 1 digits in the bit literal, e.g. B'0101'.

When it happens

Trigger: A PostgreSQL bit literal contained characters other than 0 and 1.

Common situations: See trigger scenarios.


AI-assisted analysis of OtterMind/Chat2DB@5ee1e990e7 (2026-08-14). Data as JSON: /api/errors/fca1790d2e74bd53. Report an issue: GitHub.