I'm trying to extract the time of day from a 'timestamp' column in PostgreSQL. Here is how I did it but... it's awful. An idea of how to do it better ?
SELECT (
date_part('hour', date_demande)::text || ' hours ' ||
date_part('minute', date_demande)::text || ' minutes ' ||
date_part('second', date_demande)::text || ' seconds'
)::interval AS time_of_day
FROM table;