Skip to content

Conversation

@dessanhemrayev
Copy link

In the "ofpresence" table, the "offlineDate" field has the data type "VARCHAR/CHAR" depending on the database, and in the query we are trying to compare this field with the "sentDate" field, which has the data type "BIGINT/INTEGER". This results in the following error:

ERROR: operator does not exist: bigint > character varying
LINE 3: JOIN ofPresence p ON (a.sentDate > p.offlineDate)
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.

This change replaces implicit comparison with explicit, database-specific CAST expressions. The correct CAST is selected at runtime based on the underlying database (MySQL, PostgreSQL, SQL Server, Oracle, Sybase), ensuring reliable and portable behavior across all Openfire-supported DBs.

@dessanhemrayev
Copy link
Author

dessanhemrayev commented Oct 10, 2025

Hi @Fishbowler , @guusdk
I create new PR
PR #215 closed

@dessanhemrayev
Copy link
Author

Hi @guusdk
Please check.

dessanhemrayev and others added 2 commits November 11, 2025 14:04
In the "ofpresence" table, the "offlineDate" field has the data type "VARCHAR/CHAR" depending on the
database, and in the query we are trying to compare this field with the "sentDate" field, which has
the data type "BIGINT/INTEGER". This results in the following error:

```
ERROR: operator does not exist: bigint > character varying
LINE 3: JOIN ofPresence p ON (a.sentDate > p.offlineDate)
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.
```

This change replaces implicit comparison with explicit, database-specific CAST expressions.
The correct CAST is selected at runtime based on the underlying database (MySQL, PostgreSQL,
SQL Server, Oracle, Sybase), ensuring reliable and portable behavior across all Openfire-supported DBs.
Co-authored-by: Dan Caseley <dan@caseley.me.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants