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
687d7cf3
Commit
687d7cf3
authored
21 years ago
by
Joe Conway
Browse files
Options
Downloads
Patches
Plain Diff
Documentation for generate_series() functions committed a few days ago.
parent
8d09e256
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
+91
-1
91 additions, 1 deletion
doc/src/sgml/func.sgml
with
91 additions
and
1 deletion
doc/src/sgml/func.sgml
+
91
−
1
View file @
687d7cf3
<!--
$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.18
5
200
3/12/26 21:30:48 tgl
Exp $
$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.18
6
200
4/02/05 22:54:36 joe
Exp $
PostgreSQL documentation
-->
...
...
@@ -8199,6 +8199,96 @@ AND
</sect2>
</sect1>
<sect1 id="functions-srf">
<title>Set Returning Functions</title>
<indexterm zone="functions-srf">
<primary>set returning functions</primary>
<secondary>functions</secondary>
</indexterm>
<para>
This section describes functions that possibly return more than one row.
Currently the only functions in this class are series generating functions,
as detailed in <xref linkend="functions-srf-series">.
</para>
<table id="functions-srf-series">
<title>Series Generating Functions</title>
<tgroup cols="4">
<thead>
<row>
<entry>Function</entry>
<entry>Argument Type</entry>
<entry>Return Type</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry><literal><function>generate_series</function>(<parameter>start</parameter>, <parameter>stop</parameter>)</literal></entry>
<entry><type>int</type> or <type>bigint</type></entry>
<entry><type>setof int</type> or <type>setof bigint</type> (same as argument type)</entry>
<entry>
Generate a series of values, from <parameter>start</parameter> to <parameter>stop</parameter>
with a step size of one.
</entry>
</row>
<row>
<entry><literal><function>generate_series</function>(<parameter>start</parameter>, <parameter>stop</parameter>, <parameter>step</parameter>)</literal></entry>
<entry><type>int</type> or <type>bigint</type></entry>
<entry><type>setof int</type> or <type>setof bigint</type> (same as argument type)</entry>
<entry>
Generate a series of values, from <parameter>start</parameter> to <parameter>stop</parameter>
with a step size of <parameter>step</parameter>.
</entry>
</row>
</tbody>
</tgroup>
</table>
<para>
When <parameter>step</parameter> is positive, zero rows are returned if
<parameter>start</parameter> is greater than <parameter>stop</parameter>.
Conversely, when <parameter>step</parameter> is negative, zero rows are
returned if <parameter>start</parameter> is less than <parameter>stop</parameter>.
Zero rows are also returned for <literal>NULL</literal> inputs. It is an error
for <parameter>step</parameter> to be zero. Some examples follow:
<programlisting>
select * from generate_series(2,4);
generate_series
-----------------
2
3
4
(3 rows)
select * from generate_series(5,1,-2);
generate_series
-----------------
5
3
1
(3 rows)
select * from generate_series(4,3);
generate_series
-----------------
(0 rows)
select current_date + s.a as dates from generate_series(0,14,7) as s(a);
dates
------------
2004-02-05
2004-02-12
2004-02-19
(3 rows)
</programlisting>
</para>
</sect1>
</chapter>
<!-- Keep this comment at the end of the file
...
...
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