Skip to content

Commit 75ebaa7

Browse files
author
Thomas G. Lockhart
committed
Add information regarding date and time types and functions,
including arguments allowed.
1 parent 54c38a9 commit 75ebaa7

File tree

1 file changed

+60
-51
lines changed

1 file changed

+60
-51
lines changed

src/man/built-in.3

Lines changed: 60 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" This is -*-nroff-*-
22
.\" XXX standard disclaimer belongs here....
3-
.\" $Header: /cvsroot/pgsql/src/man/Attic/built-in.3,v 1.7 1997/05/16 07:13:46 thomas Exp $
3+
.\" $Header: /cvsroot/pgsql/src/man/Attic/built-in.3,v 1.8 1997/07/02 14:13:14 thomas Exp $
44
.TH BUILT-INS INTRO 04/01/97 PostgreSQL PostgreSQL
55
.SH "DESCRIPTION"
66
This section describes the data types, functions and operators
@@ -82,7 +82,11 @@ several possibilities for formats, such as date and time types.
8282
Some date and time types share code for data input. For those types (currently
8383
.IR datetime
8484
and
85-
.IR abstime )
85+
.IR abstime
86+
, and
87+
.IR timespan
88+
and
89+
.IR reltime )
8690
the input can have any of a wide variety of styles. For numeric date representations,
8791
European and US conventions can differ, and the proper interpretation is obtained
8892
by using the
@@ -129,22 +133,22 @@ offsets to GMT (e.g. "-08" or "-08:00" when in Pacific Standard Time).
129133
Dates are stored internally in Greenwich Mean Time. Input and output routines
130134
translate time to the local time zone of the server.
131135
.PP
132-
All special values allowed for
133-
.IR "absolute time"
134-
are also allowed for
135-
.IR "datetime".
136-
The special values \*(lqcurrent\*(rq,
137-
\*(lqinfinity\*(rq and \*(lq-infinity\*(rq are provided.
138-
\*(lqinfinity\*(rq specifies a time later than any valid time, and
139-
\*(lq-infinity\*(rq specifies a time earlier than any valid time.
140-
\*(lqcurrent\*(rq indicates that the current time should be
136+
The special values `current',
137+
`infinity' and `-infinity' are provided.
138+
`infinity' specifies a time later than any valid time, and
139+
`-infinity' specifies a time earlier than any valid time.
140+
`current' indicates that the current time should be
141141
substituted whenever this value appears in a computation.
142142
.PP
143-
The strings \*(lqnow\*(rq and \*(lqepoch\*(rq can be used to specify
144-
time values. \*(lqnow\*(rq means the current time, and differs from
145-
\*(lqcurrent\*(rq in that the current time is immediately substituted
146-
for it. \*(lqepoch\*(rq means Jan 1 00:00:00 1970 GMT.
147-
143+
The strings
144+
`now',
145+
`today',
146+
`yesterday',
147+
`tomorrow',
148+
and `epoch' can be used to specify
149+
time values. `now' means the current time, and differs from
150+
`current' in that the current time is immediately substituted
151+
for it. `epoch' means Jan 1 00:00:00 1970 GMT.
148152

149153
.SH "TIMESPAN"
150154
General-use time span is input using a wide range of
@@ -165,10 +169,10 @@ Time span is specified with the following syntax:
165169
@ Quantity Unit [Direction]
166170
.sp
167171
where
168-
Quantity is ..., '-1', '0', `1', `2', ...
172+
Quantity is ..., `-1', `0', `1', `2', ...
169173
Unit is `second', `minute', `hour', `day', `week', `month', `year',
170174
or abbreviations or plurals of these units.
171-
Direction is ``ago''
175+
Direction is `ago'.
172176
.fi
173177
.SH "ABSOLUTE TIME"
174178
Absolute time (abstime) is a limited-range (+/- 68 years) and limited-precision (1 sec)
@@ -196,17 +200,10 @@ Valid dates are from Dec 13 20:45:53 1901 GMT to Jan 19 03:14:04
196200
using Greenwich Mean Time; the input and output routines default to
197201
the local time zone.
198202
.PP
199-
The special absolute time values \*(lqcurrent\*(rq,
200-
\*(lqinfinity\*(rq and \*(lq-infinity\*(rq are also provided.
201-
\*(lqinfinity\*(rq specifies a time later than any valid time, and
202-
\*(lq-infinity\*(rq specifies a time earlier than any valid time.
203-
\*(lqcurrent\*(rq indicates that the current time should be
204-
substituted whenever this value appears in a computation.
205-
.PP
206-
The strings \*(lqnow\*(rq and \*(lqepoch\*(rq can be used to specify
207-
time values. \*(lqnow\*(rq means the current time, and differs from
208-
\*(lqcurrent\*(rq in that the current time is immediately substituted
209-
for it. \*(lqepoch\*(rq means Jan 1 00:00:00 1970 GMT.
203+
All special values allowed for
204+
.IR "datetime"
205+
are also allowed for
206+
.IR "absolute time".
210207

211208
.SH "RELATIVE TIME"
212209
Relative time (reltime) is a limited-range (+/- 68 years) and limited-precision (1 sec)
@@ -506,50 +503,62 @@ tinterval
506503
.SH "FUNCTIONS"
507504
Many data types have functions available for conversion to other related types.
508505
In addition, there are some type-specific functions.
506+
.PP
507+
For the
508+
date_part() and date_trunc()
509+
functions, arguments can be
510+
`year', `month', `day', `hour', `minute', and `second',
511+
as well as the more specialized quantities
512+
`decade', `century', `millenium', `millisecond', and `microsecond'.
513+
date_part() also allows
514+
`dow'
515+
to return day of week and `epoch' to return seconds since 1970.
509516

510517
.nf
511518
Functions:
512519

513520
abstime
514-
datetime datetime(abstime) convert to datetime
515-
bool isfinite(abstime) TRUE if this is a finite time
521+
datetime datetime(abstime) convert to datetime
522+
bool isfinite(abstime) TRUE if this is a finite time
516523

517524
date
518-
datetime datetime(date) convert to datetime
519-
datetime datetime(date,time) convert to datetime
525+
datetime datetime(date) convert to datetime
526+
datetime datetime(date,time) convert to datetime
520527

521528
datetime
522-
abstime abstime(datetime) convert to abstime
523-
float8 date_part(text,datetime) specified portion of date field
524-
bool isfinite(datetime) TRUE if this is a finite time
529+
abstime abstime(datetime) convert to abstime
530+
float8 date_part(text,datetime) specified portion of date field
531+
datetime date_trunc(text,datetime) truncate date at specified units
532+
bool isfinite(datetime) TRUE if this is a finite time
525533

526534
reltime
527-
timespan timespan(reltime) convert to timespan
535+
timespan timespan(reltime) convert to timespan
528536

529537
time
530-
datetime datetime(date,time) convert to datetime
538+
datetime datetime(date,time) convert to datetime
531539

532540
timespan
533-
float8 date_part(text,timespan) specified portion of time field
534-
bool isfinite(timespan) TRUE if this is a finite time
535-
reltime reltime(timespan) convert to reltime
541+
float8 date_part(text,timespan) specified portion of time field
542+
bool isfinite(timespan) TRUE if this is a finite time
543+
reltime reltime(timespan) convert to reltime
536544

537545
box
538-
box box(point,point) convert points to box
539-
float8 area(box) area of box
546+
box box(point,point) convert points to box
547+
float8 area(box) area of box
540548

541549
path
542-
bool isopen(path) TRUE if this is an open path
543-
bool isclosed(path) TRUE if this is a closed path
550+
bool isopen(path) TRUE if this is an open path
551+
bool isclosed(path) TRUE if this is a closed path
544552

545553
circle
546-
circle circle(point,float8) convert to circle
547-
polygon polygon(npts,circle) convert to polygon with npts points
548-
float8 center(circle) radius of circle
549-
float8 radius(circle) radius of circle
550-
float8 diameter(circle) diameter of circle
551-
float8 area(circle) area of circle
554+
circle circle(point,float8) convert to circle
555+
polygon polygon(npts,circle) convert to polygon with npts points
556+
float8 center(circle) radius of circle
557+
float8 radius(circle) radius of circle
558+
float8 diameter(circle) diameter of circle
559+
float8 area(circle) area of circle
552560
.fi
561+
553562
.SH "BINARY OPERATORS"
554563
This list was generated from the Postgres system catalogs with the
555564
query:

0 commit comments

Comments
 (0)