-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Joe Conway wrote:
| Tom Lane wrote:
|
|> Maybe the best documentation answer is to create a new subsection in the
|> Functions chapter. This may be our first standard set-returning
|> function but I bet it will not be the last, so the shortness of the
|> subsection doesn't bother me.
|
|
| A first shot at documentation for generate_series() is available here in
| html form:
| http://www.joeconway.com/functions-srf.html
I seen there:
select * from generate_series(5,1,-2);
~ generate_series
- -----------------
~ 5
~ 3
~ 1
(3 rows)
I understood on your past posts that instead this result
was obtained with:
select * from generate_series(5,1,2);
~ generate_series
- -----------------
~ 5
~ 3
~ 1
(3 rows)
I think that is better have:
~ if start < end the series is ascending
~ if start > end the series is descending
~ if step > 0 the series is ascending
~ if step < 0 the series is descending
~ ( step can not be 0 )
if ( start < end ) and ( step < 0 ) the result set is empty
if ( start > end ) and ( step > 0 ) the result set is empty
IMHO this is the more natural behavior.
my 2 cents.
Regards
Gaetano Mendola
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFAIYxo7UpzwH2SGd4RAnr9AJ4//4AO9VaIQmweneB0BJe8DvKJQgCfSJOF
ejQN8TlGBjvntxoBJgk3uIk=
=HcPJ
-----END PGP SIGNATURE-----