How to store number of years, months and days in PostgreSQL? How to store number of years, months and days in PostgreSQL ?

Example: the life time of bulb is => 3 years, 4 months, 23 days

Is there any data type in PostgreSQL
You could use the interval data type here you can find a guide to start with: http://www.postgresqltutorial.com/postgresql-interval/

CREATE TABLE components
(
  id SERIAL PRIMARY KEY,
  name CHARACTER VARYING(30),
  lifetime INTERVAL
)
INSERT INTO components(id, name, lifetime) VALUES(1,'bulb','3 years 4 months 23 days 3 hours 2 minutes 1 second');