|
- spanname="name" morerows="2">
+ role="functableentry">
- age
+ age ( timestamp, timestamp )
+ interval
+
+ Subtract arguments, producing a symbolic
result that
+ uses years and months, rather than just days
+
+ age(timestamp '2001-04-10', timestamp '1957-06-13')
+ 43 years 9 mons 27 days
- age(timestamp, timestamp)
- interval
-
- |
- Subtract arguments, producing a symbolic
result that
- uses years and months, rather than just days
-
- |
- age(timestamp '2001-04-10', timestamp '1957-06-13')
- 43 years 9 mons 27 days
|
- age
- age(timestamp)
- interval
-
- |
- Subtract from current_date (at midnight)
-
- |
- age(timestamp '1957-06-13')
- variable
+
+ age ( timestamp )
+ interval
+
+ Subtract argument from current_date (at midnight)
+
+ age(timestamp '1957-06-13')
+ 62 years 6 mons 10 days
+
|
- spanname="name" morerows="2">
+ role="functableentry">
- clock_timestamp
-
- clock_timestamp()
- timestamp with time zone
-
- |
- Current date and time (changes during statement execution);
+ clock_timestamp ( )
+ timestamp with time zone
+
+ Current date and time (changes during statement execution);
see
+
+ clock_timestamp()
+ 2019-12-23 14:39:53.662522-05
- |
- clock_timestamp()
- variable
-
|
- spanname="name" morerows="2">
+ role="functableentry">
current_date
-
- current_date
- date
-
- |
- Current date;
- see
+ date
+
+ Current date; see
+
+ current_date
+ 2019-12-23
- |
- current_date
- variable
-
|
- spanname="name" morerows="2">
+ role="functableentry">
current_time
+ time with time zone
+
+ Current time of day; see
+
+ current_time
+ 14:39:53.662522-05
- current_time
- time with time zone
-
- |
- Current time of day;
- see
-
-
- |
- current_time
- variable
|
- current_time
- current_time(integer)
- time with time zone
-
- |
- Current time of day, with limited precision;
+
+ current_time ( integer )
+ time with time zone
+
+ Current time of day, with limited precision;
see
+
+ current_time(2)
+ 14:39:53.66-05
- |
- current_time(2)
- variable
-
|
- spanname="name" morerows="2">
+ role="functableentry">
current_timestamp
-
- current_timestamp
- timestamp with time zone
-
- |
- Current date and time (start of current transaction);
+ timestamp with time zone
+
+ Current date and time (start of current transaction);
see
+
+ current_timestamp
+ 2019-12-23 14:39:53.662522-05
- |
- current_timestamp
- variable
-
|
- current_timestamp
- current_timestamp(integer)
- timestamp with time zone
-
- |
- Current date and time (start of current transaction), with limited precision;
+
+ current_timestamp ( integer )
+ timestamp with time zone
+
+ Current date and time (start of current transaction), with limited precision;
see
+
+ current_timestamp(0)
+ 2019-12-23 14:39:53-05
- |
- current_timestamp(0)
- variable
-
|
- spanname="name" morerows="2">
+ role="functableentry">
- date_part
-
- date_part(text, timestamp)
- double precision
-
- |
- Get timestamp subfield (equivalent to extract);
+ date_part ( text, timestamp )
+ double precision
+
+ Get timestamp subfield (equivalent to extract);
see
+
+ date_part('hour', timestamp '2001-02-16 20:38:40')
+ 20
- |
- date_part('hour', timestamp '2001-02-16 20:38:40')
- 20
-
|
- date_part
- date_part(text, interval)
- double precision
-
- |
- Get interval subfield (equivalent to
- extract); see
+
+ date_part ( text, interval )
+ double precision
+
+ Get interval subfield (equivalent to extract);
+ see
+
+ date_part('month', interval '2 years 3 months')
+ 3
- |
- date_part('month', interval '2 years 3 months')
- 3
-
|
- spanname="name" morerows="2">
+ role="functableentry">
- date_trunc
+ date_trunc ( text, timestamp )
+ timestamp
+
+ Truncate to specified precision; see
+
+ date_trunc('hour', timestamp '2001-02-16 20:38:40')
+ 2001-02-16 20:00:00
- date_trunc(text, timestamp)
- timestamp
-
- |
- Truncate to specified precision; see
-
-
- |
- date_trunc('hour', timestamp '2001-02-16 20:38:40')
- 2001-02-16 20:00:00
|
- date_trunc
- date_trunc(text, timestamp with time zone, text)
- timestamp with time zone
-
- |
- Truncate to specified precision in the specified time zone; see
+
+ date_trunc ( text, timestamp with time zone, text )
+ timestamp with time zone
+
+ Truncate to specified precision in the specified time zone; see
+
+
+ date_trunc('day', timestamptz '2001-02-16 20:38:40+00', 'Australia/Sydney')
+ 2001-02-16 13:00:00+00
- |
- date_trunc('day', timestamptz '2001-02-16 20:38:40+00', 'Australia/Sydney')
- 2001-02-16 13:00:00+00
-
|
- date_trunc
- date_trunc(text, interval)
- interval
-
- |
- Truncate to specified precision; see
+
+ date_trunc ( text, interval )
+ interval
+
+ Truncate to specified precision; see
+
+
+ date_trunc('hour', interval '2 days 3 hours 40 minutes')
+ 2 days 03:00:00
- |
- date_trunc('hour', interval '2 days 3 hours 40 minutes')
- 2 days 03:00:00
-
|
- spanname="name" morerows="2">
+ role="functableentry">
- extract
+
extract (
field from timestamp )
+ double precision
+
+ Get timestamp subfield; see
+
+ extract(hour from timestamp '2001-02-16 20:38:40')
+ 20
-
extract(field from timestamp)
- double precision
-
- |
- Get timestamp subfield; see
-
-
- |
- extract(hour from timestamp '2001-02-16 20:38:40')
- 20
|
- extract
-
extract(field from interval)
- double precision
-
- |
- Get interval subfield; see
+
+
extract (
field from interval )
+ double precision
+
+ Get interval subfield; see
+
+ extract(month from interval '2 years 3 months')
+ 3
- |
- extract(month from interval '2 years 3 months')
- 3
-
|
- spanname="name" morerows="2">
+ role="functableentry">
- isfinite
+ isfinite ( date )
+ boolean
+
+ Test for finite date (not +/-infinity)
+
+ isfinite(date '2001-02-16')
+ true
- isfinite(date)
- boolean
-
- |
- Test for finite date (not +/-infinity)
-
- |
- isfinite(date '2001-02-16')
- true
|
- isfinite
- isfinite(timestamp)
- boolean
-
- |
- Test for finite timestamp (not +/-infinity)
-
- |
- isfinite(timestamp 'infinity')
- false
+
+ isfinite ( timestamp )
+ boolean
+
+ Test for finite timestamp (not +/-infinity)
+
+ isfinite(timestamp 'infinity')
+ false
+
|
- isfinite
- isfinite(interval)
- boolean
-
- |
- Test for finite interval (currently always true)
-
- |
- isfinite(interval '4 hours')
- true
+
+ isfinite ( interval )
+ boolean
+
+ Test for finite interval (currently always true)
+
+ isfinite(interval '4 hours')
+ true
+
|
- spanname="name" morerows="2">
+ role="functableentry">
- justify_days
+ justify_days ( interval )
+ interval
+
+ Adjust interval so 30-day time periods are represented as months
+
+ justify_days(interval '35 days')
+ 1 mon 5 days
- justify_days(interval)
- interval
-
- |
- Adjust interval so 30-day time periods are represented as months
-
- |
- justify_days(interval '35 days')
- 1 mon 5 days
|
- spanname="name" morerows="2">
+ role="functableentry">
- justify_hours
+ justify_hours ( interval )
+ interval
+
+ Adjust interval so 24-hour time periods are represented as days
+
+ justify_hours(interval '27 hours')
+ 1 day 03:00:00
- justify_hours(interval)
- interval
-
- |
- Adjust interval so 24-hour time periods are represented as days
-
- |
- justify_hours(&zwsp;interval '27 hours')
- 1 day 03:00:00
|
- spanname="name" morerows="2">
+ role="functableentry">
- justify_interval
+ justify_interval ( interval )
+ interval
+
+ Adjust interval using justify_days
+ and justify_hours, with additional sign
+ adjustments
+
+ justify_interval(interval '1 mon -1 hour')
+ 29 days 23:00:00
- justify_interval(interval)
- interval
-
- |
- Adjust interval using justify_days and justify_hours, with additional sign adjustments
-
- |
- justify_interval(&zwsp;interval '1 mon -1 hour')
- 29 days 23:00:00
|
- spanname="name" morerows="2">
+ role="functableentry">
localtime
-
- localtime
- time
-
- |
- Current time of day;
+ time
+
+ Current time of day;
see
+
+ localtime
+ 14:39:53.662522
- |
- localtime
- variable
-
|
- localtime
- localtime(integer)
- time
-
- |
- Current time of day, with limited precision;
+
+ localtime ( integer )
+ time
+
+ Current time of day, with limited precision;
see
+
+ localtime(0)
+ 14:39:53
- |
- localtime(0)
- variable
-
|
- spanname="name" morerows="2">
+ role="functableentry">
localtimestamp
-
- localtimestamp
- timestamp
-
- |
- Current date and time (start of current transaction);
+ timestamp
+
+ Current date and time (start of current transaction);
see
+
+ localtimestamp
+ 2019-12-23 14:39:53.662522
- |
- localtimestamp
- variable
-
|
- localtimestamp
- localtimestamp(integer)
- timestamp
-
- |
- Current date and time (start of current
+
+ localtimestamp ( integer )
+ timestamp
+
+ Current date and time (start of current
transaction), with limited precision;
see
+
+ localtimestamp(2)
+ 2019-12-23 14:39:53.66
- |
- localtimestamp(2)
- variable
-
|
- spanname="name" morerows="2">
+ role="functableentry">
- make_date
-
- date
-
- |
-
+ date
+
Create date from year, month and day fields
+
+ make_date(2013, 7, 15)
+ 2013-07-15
- |
- make_date(2013, 7, 15)
- 2013-07-15
-
|
- spanname="name" morerows="2">
+ role="functableentry">
- make_interval
-
-
make_interval( year int
+
make_interval (
year int
- )
- interval
-
- |
-
+ )
+ interval
+
Create interval from years, months, weeks, days, hours, minutes and
seconds fields, each of which can default to zero
+
+ make_interval(days => 10)
+ 10 days
- |
- make_interval(days => 10)
- 10 days
-
|
- spanname="name" morerows="2">
+ role="functableentry">
- make_time
-
- time
-
- |
-
+ time
+
Create time from hour, minute and seconds fields
+
+ make_time(8, 15, 23.5)
+ 08:15:23.5
- |
- make_time(8, 15, 23.5)
- 08:15:23.5
-
|
- spanname="name" morerows="2">
+ role="functableentry">
- make_timestamp
-
-
make_timestamp(year int,
+
make_timestamp (
year int,
- timestamp
-
- |
-
+ timestamp
+
Create timestamp from year, month, day, hour, minute and seconds fields
+
+ make_timestamp(2013, 7, 15, 8, 15, 23.5)
+ 2013-07-15 08:15:23.5
- |
- make_timestamp(&zwsp;2013, 7, 15, 8, 15, 23.5)
- 2013-07-15 08:15:23.5
-
|
- spanname="name" morerows="2">
+ role="functableentry">
- make_timestamptz
-
-
make_timestamptz(year int,
+
make_timestamptz (
year int,
- timestamp with time zone
-
- |
-
+ timestamp with time zone
+
Create timestamp with time zone from year, month, day, hour, minute
and seconds fields; if
timezone is not
specified, the current time zone is used
+
+ make_timestamptz(2013, 7, 15, 8, 15, 23.5)
+ 2013-07-15 08:15:23.5+01
- |
- make_timestamptz(&zwsp;2013, 7, 15, 8, 15, 23.5)
- 2013-07-15 08:15:23.5+01
-
|
- spanname="name" morerows="2">
+ role="functableentry">
- now
-
- now()
- timestamp with time zone
-
- |
- Current date and time (start of current transaction);
+ now ( )
+ timestamp with time zone
+
+ Current date and time (start of current transaction);
see
+
+ now()
+ 2019-12-23 14:39:53.662522-05
- |
- now()
- variable
-
|
- spanname="name" morerows="2">
+ role="functableentry">
- statement_timestamp
-
- statement_timestamp()
- timestamp with time zone
-
- |
- Current date and time (start of current statement);
+ statement_timestamp ( )
+ timestamp with time zone
+
+ Current date and time (start of current statement);
see
+
+ statement_timestamp()
+ 2019-12-23 14:39:53.662522-05
- |
- statement_timestamp()
- variable
-
|
- spanname="name" morerows="2">
+ role="functableentry">
- timeofday
-
- timeofday()
- text
-
- |
- Current date and time
+ timeofday ( )
+ text
+
+ Current date and time
(like clock_timestamp, but as a text string);
see
+
+ timeofday()
+ Mon Dec 23 14:39:53.662522 2019 EST
- |
- timeofday()
- variable
-
|
- spanname="name" morerows="2">
+ role="functableentry">
- transaction_timestamp
-
- transaction_timestamp()
- timestamp with time zone
-
- |
- Current date and time (start of current transaction);
+ transaction_timestamp ( )
+ timestamp with time zone
+
+ Current date and time (start of current transaction);
see
+
+ transaction_timestamp()
+ 2019-12-23 14:39:53.662522-05
+
|
- transaction_&zwsp;timestamp()
- variable
-
- |
-
+
- to_timestamp
+ to_timestamp ( double precision )
+ timestamp with time zone
+
+ Convert Unix epoch (seconds since 1970-01-01 00:00:00+00) to
+ timestamp with time zone
+
+ to_timestamp(1284352323)
+ 2010-09-13 04:32:03+00
- to_timestamp(double precision)
- timestamp with time zone
-
- |
- Convert Unix epoch (seconds since 1970-01-01 00:00:00+00) to
- timestamp
-
- |
- to_timestamp(&zwsp;1284352323)
- 2010-09-13 04:32:03+00