Create interval by string in PostgreSQL Is it possible to create an interval by string in PostgreSQL?

for example, I have a table:

CREATE TABLE x (
 id BIGSERIAL PRIMARY KEY,
 data JSONB
);
INSERT INTO x(data) VALUES('{"day_sess":"4_1"}');

-- the query:
SELECT DISTINCT (INTERVAL (LEFT(data-&gt;&gt;'day_sess',1) || ' days')) FROM x ORDER BY 1;


it always give

ERROR:  syntax error at or near "LEFT"
Ah nevermind, found the answer

SELECT DISTINCT LEFT(data-&gt;&gt;'day_sess',1)::INT * (INTERVAL '1 day') 
FROM x ORDER BY 1;