a month ago
Dear Support,
The Railway dashboard's compression stats query fails on TimescaleDB 2.x installations with the error: "Failed to parse psql output: Quote Not Closed".
Root Cause guess:
The dashboard query assumes TimescaleDB 1.x API:
SELECT hypertable_name, ... FROM hypertable_compression_stats('market_data.lmp')
In TimescaleDB 2.x, hypertable_compression_stats() no longer returns a hypertable_name column—the table name is passed as an argument instead.
The function signature changed between versions.
Impact:
- Dashboard throws parsing errors when trying to display compression stats
- 30-second statement timeout causes partial result streaming, breaking the psql output parser downstream
- Affects all Railway users running TimescaleDB 2.x
Environment:
- TimescaleDB: 2.17.2 (from Railway template)
- Project: GridNav Production
- Environment: production
Suggested Fix:
Update the dashboard query to use TimescaleDB 2.x compatible syntax, e.g.:
SELECT h.hypertable_name, ... FROM timescaledb_information.hypertables h
JOIN chunk_compression_stats(h.hypertable_id) ON TRUE
1 Replies
Status changed to Awaiting Railway Response Railway • 28 days ago
a month ago
This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.
Status changed to Open Railway • 28 days ago
11 days ago
This looks like a TimescaleDB 2.x compatibility issue, not a Railway Postgres connectivity issue.
In current TimescaleDB docs, hypertable_compression_stats() is an old compression API and is called for a single hypertable. It no longer gives the dashboard a hypertable_name column to select from. For a dashboard query that needs one row per hypertable, join the catalog list of hypertables to the per-hypertable stats call instead of selecting hypertable_name from hypertable_compression_stats() itself.
A compatible shape is:
```sql
SELECT
h.hypertable_schema,
h.hypertable_name,
s.total_chunks,
s.number_compressed_chunks,
s.before_compression_total_bytes,
s.after_compression_total_bytes
FROM timescaledb_information.hypertables h
LEFT JOIN LATERAL hypertable_compression_stats(
format('%I.%I', h.hypertable_schema, h.hypertable_name)::regclass
) s ON true;
```
If Railway's dashboard query is still assuming the 1.x return shape, that would explain both the missing-column behavior and the parser fallout. The shortest fix is to update the dashboard query to use LATERAL per hypertable, or gate the query by TimescaleDB extension version.