-
Notifications
You must be signed in to change notification settings - Fork 435
Open
Description
I have a query with a very long column name:
SELECT
time,
ROUND(MAX(CASE WHEN sensor_id = 'In1I21BK1_H922_S92_A01_BKAZonenventilH_K_K1_outStatusTrajVorgabe' THEN value END)::NUMERIC, 2) AS "In1I21BK1_H922_S92_A01_BKAZonenventilH_K_K1_outStatusTrajVorgabe"
FROM (
SELECT
sensor_id,
date_trunc('second', time) - (EXTRACT(EPOCH FROM time)::integer % $1) * interval '1 second' AS time,
ROUND(avg(value)::NUMERIC, 2) as value
FROM measurements
WHERE sensor_id = ANY(ARRAY['In1I21BK1_H922_S92_A01_BKAZonenventilH_K_K1_outStatusTrajVorgabe'])
AND time BETWEEN $2 AND $3
GROUP BY time, sensor_id
) subquery
GROUP BY time
ORDER BY time ASC
stmt = await con.prepare(query)
columns = [a.name for a in stmt.get_attributes()]
print(columns)
# yields ['time', 'In1I21BK1_H922_S92_A01_BKAZonenventilH_K_K1_outStatusTrajVorgab']
Notice the missing e
at the end.
It is not a db issue, since the query runs fine when using, e.g. SQLTools
.
Is there some limit imposed on the attribute name length?
Metadata
Metadata
Assignees
Labels
No labels