Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
ce4d01d9
Commit
ce4d01d9
authored
23 years ago
by
Tom Lane
Browse files
Options
Downloads
Patches
Plain Diff
Update description of CURRENT_TIMESTAMP and friends.
parent
78ec1cb0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/src/sgml/func.sgml
+36
-21
36 additions, 21 deletions
doc/src/sgml/func.sgml
with
36 additions
and
21 deletions
doc/src/sgml/func.sgml
+
36
−
21
View file @
ce4d01d9
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.8
7
2001/12/
01 04:19:20
tgl Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.8
8
2001/12/
23 20:22:49
tgl Exp $
PostgreSQL documentation
-->
...
...
@@ -2732,7 +2732,7 @@ PostgreSQL documentation
<row>
<entry><function>timeofday()</function></entry>
<entry><type>text</type></entry>
<entry>
High-precision
date and time; see
also
<link
<entry>
Current
date and time; see <link
linkend="functions-datetime-current">below</link>
</entry>
<entry><literal>timeofday()</literal></entry>
...
...
@@ -3208,25 +3208,50 @@ SELECT date_trunc('year', TIMESTAMP '2001-02-16 20:38:40');
The following functions are available to obtain the current date and/or
time:
<synopsis>
CURRENT_TIME
CURRENT_DATE
CURRENT_TIME
CURRENT_TIMESTAMP
CURRENT_TIME ( <replaceable>precision</> )
CURRENT_TIMESTAMP ( <replaceable>precision</> )
</synopsis>
Note that because of the requirements of the
<acronym>SQL</acronym> standard, these functions must not be
called with trailing parentheses.
<function>CURRENT_TIME</function> and
<function>CURRENT_TIMESTAMP</function> can optionally be given
a precision parameter, which causes the result to be rounded
to that many fractional digits. Without a precision parameter,
the result is given to full available precision.
</para>
<note>
<para>
Prior to <productname>PostgreSQL</> 7.2, the precision parameters
were unimplemented, and the result was always given in integer
seconds.
</para>
</note>
<note>
<para>
The <acronym>SQL99</acronym> standard requires these functions to
be written without any parentheses, unless a precision parameter
is given. As of <productname>PostgreSQL</> 7.2, an empty pair of
parentheses can be written, but this is deprecated and may be
removed in a future release.
</para>
</note>
<informalexample>
<screen>
SELECT CURRENT_TIME;
<computeroutput>1
9:07:32
</computeroutput>
<computeroutput>1
4:39:53.662522-05
</computeroutput>
SELECT CURRENT_DATE;
<computeroutput>2001-
0
2-
17
</computeroutput>
<computeroutput>2001-
1
2-
23
</computeroutput>
SELECT CURRENT_TIMESTAMP;
<computeroutput>2001-02-17 19:07:32-05</computeroutput>
<computeroutput>2001-12-23 14:39:53.662522-05</computeroutput>
SELECT CURRENT_TIMESTAMP(2);
<computeroutput>2001-12-23 14:39:53.66-05</computeroutput>
</screen>
</informalexample>
...
...
@@ -3237,9 +3262,8 @@ SELECT CURRENT_TIMESTAMP;
</para>
<para>
There is also <function>timeofday()</function>, which returns current
time to higher precision than the <function>CURRENT_TIMESTAMP</function>
family does:
There is also <function>timeofday()</function>, which for historical
reasons returns a text string rather than a <type>timestamp</type> value:
</para>
<informalexample>
...
...
@@ -3249,15 +3273,6 @@ SELECT timeofday();
</screen>
</informalexample>
<para>
<function>timeofday()</function> uses the operating system call
<function>gettimeofday(2)</function>, which may have resolution as
good as microseconds (depending on your platform); the other functions
rely on <function>time(2)</function> which is restricted to one-second
resolution. For historical reasons, <function>timeofday()</function>
returns its result as a text string rather than a <type>timestamp</type> value.
</para>
<para>
It is quite important to realize that
<function>CURRENT_TIMESTAMP</function> and related functions all return
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment