PostgreSQL ISFINITE
From w3cyberlearnings
Contents |
Postgresql isfinite
This function checks an expression(date, timestamp, or interval) for finite. It's return true for finite or null.
Syntax isfinite
- expres is date, timestamp or interval
- source is the source to check for finite
isfinite(expres source);
Example 1:Date and Timestamp
postgres=# SELECT isfinite(date '2012-04-12'); isfinite ---------- t (1 row) postgres=# SELECT isfinite(timestamp '2012-04-12 11:30:33'); isfinite ---------- t (1 row)
Example 2:Interval
postgres=# SELECT isfinite(interval '4 hours'); isfinite ---------- t (1 row) postgres=# SELECT isfinite(interval '3 days 2 hours'); isfinite ---------- t (1 row)
Example 3
postgres=# SELECT name,age, isfinite(age) FROM employee; name | age | isfinite --------+------------+---------- John | 1990-04-13 | t Week | 1991-06-12 | t Christ | 1995-05-17 | t (3 rows)
Related Links
- date_part
- date_trunc
- extract
- isfinite
- justify_days