Re: pg_generate_sequence and info_schema patch (Was: SELECT

From: Gaetano Mendola <mendola(at)bigfoot(dot)com>
To: "pgsql-patches(at)postgresql(dot)org" <pgsql-patches(at)postgresql(dot)org>
Cc: Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: pg_generate_sequence and info_schema patch (Was: SELECT
Date: 2004-02-05 00:20:56
Message-ID: 40218C68.5000509@bigfoot.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-patches

-----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-----

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mike Mascari 2004-02-05 00:31:33 Re: Improving performance with a Function instead of a
Previous Message Oleg Lebedev 2004-02-05 00:08:37 dblink: rollback transaction

Browse pgsql-patches by date

  From Date Subject
Next Message Claudio Natoli 2004-02-05 01:17:41 Re: win32 signals, part 4
Previous Message Magnus Hagander 2004-02-04 23:15:44 Re: temp patch for win32 readdir issue