When working with dates and time in PostgreSQL, understanding the available date/time types is useful. As a Postgres user, let’s explore these types in more detail.
Interval: Represents a duration of time (e.g., event duration).
Stored as 16 bytes.
Example:
Copy
Ask AI
CREATE TABLE tasks ( task_id serial PRIMARY KEY, task_duration interval);INSERT INTO tasks (task_duration) VALUES ('2 days 3 hours');
Remember to adapt these examples to your specific use case. Happy querying!For more detailed information, consult the official PostgreSQL documentation. If you have further questions, feel free to ask us on our Discord!