Skip to content

Conversation

@joltcan
Copy link

@joltcan joltcan commented Feb 3, 2026

Problem

When running OpenTAKServer on with PostgreSQL, the /Marti/api/cot/xml/... endpoint fails with a psycopg.errors.UndefinedFunction: operator does not exist: timestamp without time zone >= interval.

This happens because SQLAlchemy/Postgres cannot compare a CoT.start (timestamp) directly against a timedelta (interval).

Solution

Modified the filter to compare the CoT.start timestamp against a calculated datetime object (Current Time - Delta) instead of passing the delta directly to the query.

Testing

  • Environment: Ubuntu 24.04, Python 3.12, PostgreSQL 16.
  • Verified that the GET request now returns valid XML CoT data instead of a 500 Internal Server Error.

## Problem
When running OpenTAKServer on with PostgreSQL, the `/Marti/api/cot/xml/...` endpoint fails with a `psycopg.errors.UndefinedFunction: operator does not exist: timestamp without time zone >= interval`.

This happens because SQLAlchemy/Postgres cannot compare a `CoT.start` (timestamp) directly against a `timedelta` (interval).

## Solution
Modified the filter to compare the `CoT.start` timestamp against a calculated `datetime` object (Current Time - Delta) instead of passing the delta directly to the query.

## Testing
- Environment: Ubuntu 24.04, Python 3.12, PostgreSQL 16.
- Verified that the GET request now returns valid XML CoT data instead of a 500 Internal Server Error.
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.

1 participant